Package org.jdom
Class CDATA
java.lang.Object
org.jdom.Content
org.jdom.Text
org.jdom.CDATA
- All Implemented Interfaces:
Serializable
,Cloneable
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.- Version:
- $Revision: 1.32 $, $Date: 2007/11/10 05:28:58 $
- Author:
- Dan Schaffer, Brett McLaughlin, Jason Hunter, Bradley S. Huffman, Victor Toni
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This will append character content to whatever content already exists within thisCDATA
node.void
This will append the content of anotherText
node to this node.This will set the value of thisCDATA
node.toString()
This returns aString
representation of theCDATA
node, suitable for debugging.Methods inherited from class org.jdom.Text
clone, getText, getTextNormalize, getTextTrim, getValue, normalizeString
Methods inherited from class org.jdom.Content
detach, equals, getDocument, getParent, getParentElement, hashCode, setParent
-
Constructor Details
-
CDATA
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. -
CDATA
This constructor creates a newCDATA
node, with the supplied string value as it's character content.- Parameters:
string
- the node's character content.- Throws:
IllegalDataException
- ifstr
contains an illegal character such as a vertical tab (as determined byVerifier.checkCharacterData(java.lang.String)
) or the CDATA end delimiter]]>
.
-
-
Method Details
-
setText
This will set the value of thisCDATA
node.- Overrides:
setText
in classText
- Parameters:
str
- value for node's content.- Returns:
- the object on which the method was invoked
- Throws:
IllegalDataException
- ifstr
contains an illegal character such as a vertical tab (as determined byVerifier.checkCharacterData(java.lang.String)
) or the CDATA end delimiter]]>
.
-
append
This will append character content to whatever content already exists within thisCDATA
node.- Overrides:
append
in classText
- Parameters:
str
- character content to append.- Throws:
IllegalDataException
- ifstr
contains an illegal character such as a vertical tab (as determined byVerifier.checkCharacterData(java.lang.String)
) or the CDATA end delimiter]]>
.
-
append
This will append the content of anotherText
node to this node. -
toString
This returns aString
representation of theCDATA
node, suitable for debugging. If the XML representation of theCDATA
node is desired, either
orText.getText()
XMLOutputter.output(CDATA, java.io.Writer)
should be used.
-