java.lang.ObjectContent
Text
CDATA
public class CDATA
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.
Field Summary | |
---|---|
private static java.lang.String |
CVS_ID
|
Fields inherited from class Text |
---|
EMPTY_STRING, value |
Fields inherited from class Content |
---|
parent |
Constructor Summary | |
---|---|
protected |
CDATA()
This is the protected, no-args constructor standard in all JDOM classes. |
|
CDATA(java.lang.String str)
This constructor creates a new CDATA node, with the
supplied string value as it's character content. |
Method Summary | |
---|---|
void |
append(java.lang.String str)
This will append character content to whatever content already exists within this CDATA node. |
Text |
setText(java.lang.String str)
This will set the value of this CDATA node. |
java.lang.String |
toString()
This returns a String representation of the
CDATA node, suitable for debugging. |
Methods inherited from class Text |
---|
append, clone, getText, getTextNormalize, getTextTrim, getValue, normalizeString |
Methods inherited from class Content |
---|
detach, equals, getDocument, getParent, getParentElement, hashCode, setParent |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String CVS_ID
Constructor Detail |
---|
protected CDATA()
public CDATA(java.lang.String str)
CDATA
node, with the
supplied string value as it's character content.
str
- the node's character content.
IllegalDataException
- if str
contains an
illegal character such as a vertical tab (as determined
by Verifier.checkCharacterData(java.lang.String)
)
or the CDATA end delimiter ]]>
.Method Detail |
---|
public Text setText(java.lang.String str)
CDATA
node.
setText
in class Text
str
- value for node's content.
IllegalDataException
- if str
contains an
illegal character such as a vertical tab (as determined
by Verifier.checkCharacterData(java.lang.String)
)
or the CDATA end delimiter ]]>
.public void append(java.lang.String str)
CDATA
node.
append
in class Text
str
- character content to append.
IllegalDataException
- if str
contains an
illegal character such as a vertical tab (as determined
by Verifier.checkCharacterData(java.lang.String)
)
or the CDATA end delimiter ]]>
.public java.lang.String toString()
String
representation of the
CDATA
node, suitable for debugging. If the XML
representation of the CDATA
node is desired,
either Text.getText()
or
output.XMLOutputter#output(CDATA, java.io.Writer)
should be used.
toString
in class Text
String
- information about this node.