Top Description Fields Constructors Methods
org.jdom

public Class Comment

extends Content
Class Inheritance

An XML comment. Methods allow the user to get and set the text of the comment.
Authors
Brett McLaughlin, Jason Hunter
Version
$Revision: 1.33 $, $Date: 2007/11/10 05:28:58 $

Field Summary

Modifier and TypeField and Description
private static final String
protected String
text

Text of the Comment

Inherited from org.jdom.Content:
parent

Constructor Summary

AccessConstructor and Description
protected
Comment()

Default, no-args constructor for implementations to use if needed.

public
Comment(String
String content of comment.
text
)

This creates the comment with the supplied text.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

String - text of comment.
getText
()

This returns the textual data within the Comment.

public String

Returns:

the text of this comment
getValue
()

Implements abstract org.jdom.Content.getValue.

Returns the XPath 1.0 string value of this element, which is the text of this comment.
public Comment

Returns:

Comment - this Comment modified.
setText
(String
String text for comment.
text
)

This will set the value of the Comment.

public String

Returns:

String - information about the Attribute
toString
()

Overrides java.lang.Object.toString.

This returns a String representation of the Comment, suitable for debugging.
Inherited from org.jdom.Content:
clonedetachequalsgetDocumentgetParentgetParentElementhashCodesetParent

Field Detail

CVS_IDback to summary
private static final String CVS_ID
textback to summary
protected String text

Text of the Comment

Constructor Detail

Commentback to summary
protected Comment()

Default, no-args constructor for implementations to use if needed.

Commentback to summary
public Comment(String text)

This creates the comment with the supplied text.

Parameters
text:String

String content of comment.

Method Detail

getTextback to summary
public String getText()

This returns the textual data within the Comment.

Returns:String

String - text of comment.

getValueback to summary
public String getValue()

Implements abstract org.jdom.Content.getValue.

Returns the XPath 1.0 string value of this element, which is the text of this comment.

Returns:String

the text of this comment

setTextback to summary
public Comment setText(String text)

This will set the value of the Comment.

Parameters
text:String

String text for comment.

Returns:Comment

Comment - this Comment modified.

Exceptions
IllegalDataException:
if the given text is illegal for a Comment.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

This returns a String representation of the Comment, suitable for debugging. If the XML representation of the Comment is desired, org.jdom.output.XMLOutputter#outputString(Comment) should be used.

Returns:String

String - information about the Attribute