org.jdom
public class Comment extends Object implements Serializable, Cloneable
Comment
defines behavior for an XML
comment, modeled in Java. Methods
allow the user to obtain the text of the comment.
Version: $Revision: 1.22 $, $Date: 2002/03/20 15:16:32 $
Field Summary | |
---|---|
protected Object | parent Parent element, document, or null if none |
protected String | text Text of the Comment |
Constructor Summary | |
---|---|
protected | Comment() Default, no-args constructor for implementations to use if needed. |
Comment(String text) This creates the comment with the supplied text. |
Method Summary | |
---|---|
Object | clone()
This will return a clone of this |
Comment | detach()
This detaches the |
boolean | equals(Object ob)
This tests for equality of this |
Document | getDocument() |
Element | getParent()
This will return the parent of this |
String | getText()
This returns the textual data within the
|
int | hashCode()
This returns the hash code for this |
protected Comment | setDocument(Document document)
This sets the |
protected Comment | setParent(Element parent)
This will set the parent of this |
Comment | setText(String text)
This will set the value of the |
String | toString()
This returns a |
Comment
Default, no-args constructor for implementations to use if needed.
This creates the comment with the supplied text.
Parameters: text String
content of comment.
This will return a clone of this Comment
.
Returns: Object
- clone of this Comment
.
This detaches the Comment
from its parent, or does
nothing if the Comment
has no parent.
Returns: Comment
- this
Comment
modified.
This tests for equality of this Comment
to the supplied
Object
.
Parameters: ob Object
to compare to.
Returns: boolean
- whether the Comment
is
equal to the supplied Object
.
This retrieves the owning Document
for
this Comment, or null if not a currently a member of a
Document
.
Returns: Document
owning this Element, or null.
This will return the parent of this Comment
.
If there is no parent, then this returns null
.
Returns: parent of this Comment
This returns the textual data within the
Comment
.
Returns: String
- text of comment.
This returns the hash code for this Comment
.
Returns: int
- hash code.
This sets the Document
parent of this comment.
Parameters: document Document
parent
Returns: this Comment
modified
This will set the parent of this Comment
.
Parameters: parent Element
to be new parent.
Returns: this Comment
modified.
This will set the value of the Comment
.
Parameters: text String
text for comment.
Returns: Comment
- this Comment modified.
Throws: IllegalDataException if the given text is illegal for a Comment.
This returns a String
representation of the
Comment
, suitable for debugging. If the XML
representation of the Comment
is desired,
outputString
should be used.
Returns: String
- information about the
Attribute