Top Description Fields Constructors Methods
org.jdom

public Class CDATA

extends Text
Class Inheritance

An XML CDATA section. Represents character-based content within an XML document that should be output within special CDATA tags. Semantically it's identical to a simple Text object, but output behavior is different. CDATA makes no guarantees about the underlying textual representation of character data, but does expose that data as a Java String.
Authors
Dan Schaffer, Brett McLaughlin, Jason Hunter, Bradley S. Huffman, Victor Toni
Version
$Revision: 1.32 $, $Date: 2007/11/10 05:28:58 $

Field Summary

Modifier and TypeField and Description
private static final String
Inherited from org.jdom.Text:
EMPTY_STRINGvalue

Constructor Summary

AccessConstructor and Description
protected
CDATA()

This is the protected, no-args constructor standard in all JDOM classes.

public
CDATA(final String
the node's character content.
string
)

This constructor creates a new CDATA node, with the supplied string value as it's character content.

Method Summary

Modifier and TypeMethod and Description
public void
append(final String
character content to append.
str
)

Overrides org.jdom.Text.append.

This will append character content to whatever content already exists within this CDATA node.
public void
append(final Text
Text node to append.
text
)

Overrides org.jdom.Text.append.

This will append the content of another Text node to this node.
public Text

Returns:

the object on which the method was invoked
setText
(final String
value for node's content.
str
)

Overrides org.jdom.Text.setText.

This will set the value of this CDATA node.
public String

Returns:

String - information about this node.
toString
()

Overrides org.jdom.Text.toString.

This returns a String representation of the CDATA node, suitable for debugging.
Inherited from org.jdom.Text:
clonegetTextgetTextNormalizegetTextTrimgetValuenormalizeString

Field Detail

CVS_IDback to summary
private static final String CVS_ID

Hides org.jdom.Text.CVS_ID.

Constructor Detail

CDATAback to summary
protected CDATA()

This is the protected, no-args constructor standard in all JDOM classes. It allows subclassers to get a raw instance with no initialization.

CDATAback to summary
public CDATA(final String string)

This constructor creates a new CDATA node, with the supplied string value as it's character content.

Parameters
string:String

the node's character content.

Exceptions
IllegalDataException:
if str contains an illegal character such as a vertical tab (as determined by org.jdom.Verifier#checkCharacterData) or the CDATA end delimiter ]]>.

Method Detail

appendback to summary
public void append(final String str)

Overrides org.jdom.Text.append.

This will append character content to whatever content already exists within this CDATA node.

Parameters
str:String

character content to append.

Exceptions
IllegalDataException:
if str contains an illegal character such as a vertical tab (as determined by org.jdom.Verifier#checkCharacterData) or the CDATA end delimiter ]]>.
appendback to summary
public void append(final Text text)

Overrides org.jdom.Text.append.

This will append the content of another Text node to this node.

Parameters
text:Text

Text node to append.

setTextback to summary
public Text setText(final String str)

Overrides org.jdom.Text.setText.

This will set the value of this CDATA node.

Parameters
str:String

value for node's content.

Returns:Text

the object on which the method was invoked

Exceptions
IllegalDataException:
if str contains an illegal character such as a vertical tab (as determined by org.jdom.Verifier#checkCharacterData) or the CDATA end delimiter ]]>.
toStringback to summary
public String toString()

Overrides org.jdom.Text.toString.

This returns a String representation of the CDATA node, suitable for debugging. If the XML representation of the CDATA node is desired, either getText or org.jdom.output.XMLOutputter#output(CDATA, java.io.Writer) should be used.

Returns:String

String - information about this node.