|
JDOM2 0.0.2-BETA |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jdom2.Content org.jdom2.Comment
public class Comment
An XML comment. Methods allow the user to get and set the text of the comment.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jdom2.Content |
---|
Content.CType |
Field Summary | |
---|---|
protected java.lang.String |
text
Text of the Comment |
Fields inherited from class org.jdom2.Content |
---|
ctype, parent |
Constructor Summary | |
---|---|
protected |
Comment()
Default, no-args constructor for implementations to use if needed. |
|
Comment(java.lang.String text)
This creates the comment with the supplied text. |
Method Summary | |
---|---|
Comment |
clone()
Returns a deep, unattached copy of this child and its descendants detached from any parent or document. |
Comment |
detach()
Detaches this child from its parent or does nothing if the child has no parent. |
java.lang.String |
getText()
This returns the textual data within the Comment . |
java.lang.String |
getValue()
Returns the XPath 1.0 string value of this element, which is the text of this comment. |
protected Comment |
setParent(Parent parent)
Sets the parent of this Content. |
Comment |
setText(java.lang.String text)
This will set the value of the Comment . |
java.lang.String |
toString()
This returns a String representation of the
Comment , suitable for debugging. |
Methods inherited from class org.jdom2.Content |
---|
equals, getCType, getDocument, getNamespacesInherited, getNamespacesInScope, getNamespacesIntroduced, getParent, getParentElement, hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String text
Comment
Constructor Detail |
---|
protected Comment()
public Comment(java.lang.String text)
text
- String
content of comment.Method Detail |
---|
public java.lang.String getValue()
getValue
in class Content
public java.lang.String getText()
Comment
.
String
- text of comment.public Comment setText(java.lang.String text)
Comment
.
text
- String
text for comment.
Comment
- this Comment modified.
IllegalDataException
- if the given text is illegal for a
Comment.public Comment clone()
Content
This method can be overridden by particular Content subclasses to return
a specific type of Content (co-variant return type). All overriding
subclasses must call super.clone()
;
clone
in class Content
public Comment detach()
Content
This method can be overridden by particular Content subclasses to return
a specific type of Content (co-variant return type). All overriding
subclasses must call super.detach()
;
detach
in class Content
protected Comment setParent(Parent parent)
Content
This method can be overridden by particular Content subclasses to return
a specific type of Content (co-variant return type). All overriding
subclasses must call super.setParent(Parent)
;
setParent
in class Content
parent
- new parent element
public java.lang.String toString()
String
representation of the
Comment
, suitable for debugging. If the XML
representation of the Comment
is desired,
XMLOutputter.outputString(Comment)
should be used.
toString
in class java.lang.Object
String
- information about the
Comment
|
JDOM2 0.0.2-BETA |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |