JDOM
1.1.3

org.jdom
Class Comment

java.lang.Object
  extended by org.jdom.Content
      extended by org.jdom.Comment
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Comment
extends Content

An XML comment. Methods allow the user to get and set the text of the comment.

Version:
$Revision: 1.1 $, $Date: 2012/04/08 22:47:59 $
Author:
Brett McLaughlin, Jason Hunter
See Also:
Serialized Form

Field Summary
protected  java.lang.String text
          Text of the Comment
 
Fields inherited from class org.jdom.Content
parent
 
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.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.
 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 org.jdom.Content
clone, detach, equals, getDocument, getParent, getParentElement, hashCode, setParent
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

text

protected java.lang.String text
Text of the Comment

Constructor Detail

Comment

protected Comment()
Default, no-args constructor for implementations to use if needed.


Comment

public Comment(java.lang.String text)
This creates the comment with the supplied text.

Parameters:
text - String content of comment.
Method Detail

getValue

public java.lang.String getValue()
Returns the XPath 1.0 string value of this element, which is the text of this comment.

Specified by:
getValue in class Content
Returns:
the text of this comment

getText

public java.lang.String getText()
This returns the textual data within the Comment.

Returns:
String - text of comment.

setText

public Comment setText(java.lang.String text)
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.

toString

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.

Overrides:
toString in class java.lang.Object
Returns:
String - information about the Attribute

JDOM
1.1.3

Copyright © 2011 Jason Hunter, Brett McLaughlin. All Rights Reserved.