public class Comment extends Content
Content.CType
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
text
Text of the
Comment |
Modifier | Constructor and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
Comment |
clone()
Return a deep clone of this instance.
|
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. |
equals, getCType, getDocument, getNamespacesInherited, getNamespacesInScope, getNamespacesIntroduced, getParent, getParentElement, hashCode
protected Comment()
public Comment(java.lang.String text)
text
- String
content of comment.public java.lang.String getValue()
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()
All JDOM core classes are Cloneable, and never throw CloneNotSupportedException. Additionally all Cloneable JDOM classes return the correct type of instance from this method and there is no need to cast the result (co-variant return value).
Subclasses of this should still call super.clone() in their clone method.
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()
;
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)
;
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
Copyright © 2021 Jason Hunter, Brett McLaughlin. All Rights Reserved.