org.jdom

Class Comment

Implemented Interfaces:
Cloneable, Serializable

public class Comment
extends Content

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

Version:
$Revision: 1.32 $, $Date: 2004/02/11 21:12:43 $

Authors:
Brett McLaughlin
Jason Hunter

Field Summary

protected String
text
Text of the Comment

Fields inherited from class org.jdom.Content

parent

Constructor Summary

Comment()
Default, no-args constructor for implementations to use if needed.
Comment(String text)
This creates the comment with the supplied text.

Method Summary

String
getText()
This returns the textual data within the Comment.
String
getValue()
Returns the XPath 1.0 string value of this element, which is the text of this comment.
Comment
setText(String text)
This will set the value of the Comment.
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, getValue, hashCode, setParent

Field Details

text

protected String text
Text of the Comment

Constructor Details

Comment

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


Comment

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

Parameters:
text - String content of comment.

Method Details

getText

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

Returns:
String - text of comment.


getValue

public String getValue()
Returns the XPath 1.0 string value of this element, which is the text of this comment.
Overrides:
getValue in interface Content

Returns:
the text of this comment


setText

public Comment setText(String text)
This will set the value of the Comment.

Parameters:
text - String text for comment.

Returns:
Comment - this Comment modified.


toString

public String toString()

Returns:
String - information about the Attribute


Copyright B) 2004 Jason Hunter, Brett McLaughlin. All Rights Reserved.