Package org.jdom
Class Comment
java.lang.Object
org.jdom.Content
org.jdom.Comment
- All Implemented Interfaces:
Serializable
,Cloneable
An XML comment. Methods allow the user to get and set the text of the
comment.
- Version:
- $Revision: 1.33 $, $Date: 2007/11/10 05:28:58 $
- Author:
- Brett McLaughlin, Jason Hunter
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetText()
This returns the textual data within theComment
.getValue()
Returns the XPath 1.0 string value of this element, which is the text of this comment.This will set the value of theComment
.toString()
This returns aString
representation of theComment
, suitable for debugging.Methods inherited from class org.jdom.Content
clone, detach, equals, getDocument, getParent, getParentElement, hashCode, setParent
-
Field Details
-
text
Text of theComment
-
-
Constructor Details
-
Comment
protected Comment()Default, no-args constructor for implementations to use if needed. -
Comment
This creates the comment with the supplied text.- Parameters:
text
-String
content of comment.
-
-
Method Details
-
getValue
Returns the XPath 1.0 string value of this element, which is the text of this comment. -
getText
This returns the textual data within theComment
.- Returns:
String
- text of comment.
-
setText
This will set the value of theComment
.- Parameters:
text
-String
text for comment.- Returns:
Comment
- this Comment modified.- Throws:
IllegalDataException
- if the given text is illegal for a Comment.
-
toString
This returns aString
representation of theComment
, suitable for debugging. If the XML representation of theComment
is desired,XMLOutputter.outputString(Comment)
should be used.
-