public class CDATA extends Text
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.Content.CType
构造器和说明 |
---|
CDATA(java.lang.String string)
This constructor creates a new
CDATA node, with the
supplied string value as it's character content. |
限定符和类型 | 方法和说明 |
---|---|
void |
append(java.lang.String str)
This will append character content to whatever content already
exists within this
CDATA node. |
void |
append(Text text)
This will append the content of another
Text node
to this node. |
CDATA |
clone()
Return a deep clone of this instance.
|
CDATA |
detach()
Detaches this child from its parent or does nothing if the child
has no parent.
|
CDATA |
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.
|
getParent, getText, getTextNormalize, getTextTrim, getValue, normalizeString
equals, getCType, getDocument, getNamespacesInherited, getNamespacesInScope, getNamespacesIntroduced, getParentElement, hashCode
public CDATA(java.lang.String string)
CDATA
node, with the
supplied string value as it's character content.string
- 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 ]]>
.public CDATA setText(java.lang.String str)
CDATA
node.setText
在类中 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
在类中 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 void append(Text text)
Text
node
to this node.public java.lang.String toString()
XMLOutputter.output(CDATA, java.io.Writer)
should be used.public CDATA clone()
All JDOM core classes are Cloneable, and never throw CloneNotSupportedException. Additionally all Cloneable JDOM classes return the correct type of instance from this method and there is no need to cast the result (co-variant return vaue).
Subclasses of this should still call super.clone() in their clone method.
public CDATA detach()
Content
This method can be overridden by particular Content subclasses to return
a specific type of Content (co-variant return type). All overriding
subclasses must call super.detach()
;