All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----org.jdom.CDATA
CDATA
represents character-based content within an
XML document represented by JDOM. It is intended to provide a modular,
printable method of representing CDATA. Additionally,
CDATA
makes no guarantees about the underlying textual
representation of character data, but does expose that data as a Java
String
.
CDATA
node's parent.
This is the protected, no-args constructor standard in all JDOM classes.
This constructor creates a new CDATA
node, with the
supplied string value as it's character content.
This will append the content of another CDATA
node
to this node.
This will append character content to whatever content already
exists within this CDATA
node.
This will return a clone of this CDATA
node, with the
same character content, but no parent.
Detaches the CDATA
from its parent, or does nothing
if the CDATA
has no parent.
This tests for equality of this CDATA
to the supplied
Object
, explicitly using the == operator.
This retrieves the owning This will return the parent of this This returns the value of this
This returns the textual content with all surrounding whitespace
removed and internal whitespace normalized to a single space.
This returns the textual content with all surrounding whitespace
removed.
This will generate a hash code for this node. This will set the parent of the This will set the value of this This returns a {
getParent()
CDATA
node, which
is always a JDOM {
getText()
CDATA
node as a Java
String
.
getTextNormalize()
getTextTrim()
hashCode()
setParent(Element)
CDATA
node to the
supplied {
setText(String)
CDATA
node.
toString()
String
representation of the
CDATA
node, suitable for debugging.
protected String value
protected Object parent
CDATA
node's parent.
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.
public CDATA(String str)
This constructor creates a new CDATA
node, with the
supplied string value as it's character content.
public String getText()
This returns the value of this CDATA
node as a Java
String
.
String
- character content of this node.
public String getTextTrim()
This returns the textual content with all surrounding whitespace removed. If only whitespace exists, the empty string is returned.
public String getTextNormalize()
This returns the textual content with all surrounding whitespace removed and internal whitespace normalized to a single space. If only whitespace exists, the empty string is returned.
public CDATA setText(String str)
This will set the value of this CDATA
node.
public void append(String str)
This will append character content to whatever content already
exists within this CDATA
node.
public void append(CDATA cdata)
This will append the content of another CDATA
node
to this node.
public Element getParent()
This will return the parent of this CDATA
node, which
is always a JDOM {@link Element}
.
Element
- this node's parent.
public Document getDocument()
This retrieves the owning {@link Document}
for
this CDATA
, or null if not a currently a member
of a {@link Document}
.
Document
owning this CDATA
, or null.
protected CDATA setParent(Element parent)
This will set the parent of the CDATA
node to the
supplied {@link Element}
. This method is intentionally
left as protected
so that only JDOM internals use it.
If you need an instance of this CDATA
node with a new
parent, you should get a copy of this node with
{@link #clone}
and set it on the desired (new) parent
Element
.
public CDATA detach()
Detaches the CDATA
from its parent, or does nothing
if the CDATA
has no parent.
CDATA
- this CDATA
modified.
public String toString()
This returns a String
representation of the
CDATA
node, suitable for debugging. If the XML
representation of the CDATA
node is desired,
either {@link #getText}
or
{@link org.jdom.output.XMLOutputter#output(CDATA, Writer)}
should be used.
String
- information about this node.
public final int hashCode()
This will generate a hash code for this node.
int
- hash code for this node.
public Object clone()
This will return a clone of this CDATA
node, with the
same character content, but no parent.
CDATA
- cloned node.
public final boolean equals(Object ob)
This tests for equality of this CDATA
to the supplied
Object
, explicitly using the == operator.
Object
to compare to
CDATA
nodes are equal
All Packages Class Hierarchy This Package Previous Next Index