|
JDOM 2.0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdom2.Content
org.jdom2.Text
org.jdom2.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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jdom2.Content |
---|
Content.CType |
Field Summary |
---|
Fields inherited from class org.jdom2.Text |
---|
value |
Fields inherited from class org.jdom2.Content |
---|
ctype, parent |
Constructor Summary | |
---|---|
protected |
CDATA()
This is the protected, no-args constructor standard in all JDOM classes. |
|
CDATA(java.lang.String string)
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. |
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. |
protected CDATA |
setParent(Parent parent)
Sets the parent of this Content. |
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. |
Methods inherited from class org.jdom2.Text |
---|
getParent, getText, getTextNormalize, getTextTrim, getValue, normalizeString |
Methods inherited from class org.jdom2.Content |
---|
equals, getCType, getDocument, getNamespacesInherited, getNamespacesInScope, getNamespacesIntroduced, getParentElement, hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected CDATA()
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 ]]>
.Method Detail |
---|
public CDATA 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 void append(Text text)
Text
node
to this node.
append
in class Text
text
- Text node to append.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
XMLOutputter.output(CDATA, java.io.Writer)
should be used.
toString
in class Text
String
- information about this node.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.
clone
in class Text
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()
;
detach
in class Text
protected CDATA setParent(Parent parent)
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.setParent(Parent)
;
setParent
in class Text
parent
- new parent element
|
JDOM 2.0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |