|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.jdom.Comment
Comment defines behavior for an XML
comment, modeled in Java. Methods
allow the user to obtain the text of the comment.
| Field Summary | |
protected java.lang.Object |
parent
Parent element, document, or null if none |
protected java.lang.String |
text
Text of the Comment |
| 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 | |
java.lang.Object |
clone()
This will return a clone of this Comment. |
Comment |
detach()
This detaches the Comment from its parent, or does
nothing if the Comment has no parent. |
boolean |
equals(java.lang.Object ob)
This tests for equality of this Comment to the supplied
Object. |
Document |
getDocument()
This retrieves the owning for
this Comment, or null if not a currently a member of a
. |
Element |
getParent()
This will return the parent of this Comment. |
java.lang.String |
getText()
This returns the textual data within the Comment. |
int |
hashCode()
This returns the hash code for this Comment. |
protected Comment |
setDocument(Document document)
This sets the parent of this comment. |
protected Comment |
setParent(Element parent)
This will set the parent of this Comment. |
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 java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.String text
Comment
protected java.lang.Object parent
| Constructor Detail |
protected Comment()
Default, no-args constructor for implementations to use if needed.
public Comment(java.lang.String text)
This creates the comment with the supplied text.
text - String content of comment.| Method Detail |
public Element getParent()
This will return the parent of this Comment.
If there is no parent, then this returns null.
Commentprotected Comment setParent(Element parent)
This will set the parent of this Comment.
parent - Element to be new parent.
Comment modified.public Comment detach()
This detaches the Comment from its parent, or does
nothing if the Comment has no parent.
Comment - this
Comment modified.public Document getDocument()
This retrieves the owning for
this Comment, or null if not a currently a member of a
Document.
Document
Document owning this Element, or null.protected Comment setDocument(Document document)
This sets the parent of this comment.
Document
document - Document parent
Comment modifiedpublic java.lang.String getText()
This returns the textual data within the
Comment.
String - text of comment.public Comment setText(java.lang.String text)
This will set the value of the Comment.
text - String text for comment.
Comment - this Comment modified.
IllegalDataException - if the given text is illegal for a
Comment.public java.lang.String toString()
This returns a 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.ObjectString - information about the
Attributepublic final boolean equals(java.lang.Object ob)
This tests for equality of this Comment to the supplied
Object.
equals in class java.lang.Objectob - Object to compare to.
boolean - whether the Comment is
equal to the supplied Object.public final int hashCode()
This returns the hash code for this Comment.
hashCode in class java.lang.Objectint - hash code.public java.lang.Object clone()
This will return a clone of this Comment.
clone in class java.lang.ObjectObject - clone of this Comment.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||