Main Page | Namespace List | Class Hierarchy | Class List | Class Members | Related Pages

org::jdom::CDATA Class Reference

List of all members.

Public Member Functions

 CDATA (String str)
String getText ()
String getTextTrim ()
String getTextNormalize ()
CDATA setText (String str)
void append (String str)
void append (CDATA cdata)
Element getParent ()
Document getDocument ()
CDATA detach ()
String toString ()
final int hashCode ()
Object clone ()
final boolean equals (Object ob)

Protected Member Functions

 CDATA ()
CDATA setParent (Element parent)

Protected Attributes

String value
Element parent

Detailed Description

CDATA represents character-based content within an XML document represented by JDOM. It is intended to provide a modular, perantable 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.

Author:
Dan Schaffer

Brett McLaughlin

Jason Hunter

Bradley S. Huffman

Version:
Revision
1.18
,
Date
2002/01/26 07:57:37


Constructor & Destructor Documentation

org::jdom::CDATA::CDATA  )  [inline, protected]
 

This is the protected, no-args constructor standard in all JDOM classes. It allows subclassers to get a raw instance with no initialization.

org::jdom::CDATA::CDATA String  str  )  [inline]
 

This constructor creates a new CDATA node, with the supplied string value as it's character content.

Parameters:
str the node's character content.


Member Function Documentation

void org::jdom::CDATA::append CDATA  cdata  )  [inline]
 

This will append the content of another CDATA node to this node.

Parameters:
cdata CDATA node to append.

void org::jdom::CDATA::append String  str  )  [inline]
 

This will append character content to whatever content already exists within this CDATA node.

Parameters:
str character content to append.

Object org::jdom::CDATA::clone  )  [inline]
 

This will return a clone of this CDATA node, with the same character content, but no parent.

Returns:
CDATA - cloned node.

CDATA org::jdom::CDATA::detach  )  [inline]
 

Detaches the CDATA from its parent, or does nothing if the CDATA has no parent.

Returns:
CDATA - this CDATA modified.

final boolean org::jdom::CDATA::equals Object  ob  )  [inline]
 

This tests for equality of this CDATA to the supplied Object, explicitly using the == operator.

Parameters:
ob Object to compare to
Returns:
whether the CDATA nodes are equal

Document org::jdom::CDATA::getDocument  )  [inline]
 

This retrieves the owning Document for this CDATA, or null if not a currently a member of a Document.

Returns:
Document owning this CDATA, or null.

Element org::jdom::CDATA::getParent  )  [inline]
 

This will return the parent of this CDATA node, which is always a JDOM Element.

Returns:
Element - this node's parent.

String org::jdom::CDATA::getText  )  [inline]
 

This returns the value of this CDATA node as a Java String.

Returns:
String - character content of this node.

String org::jdom::CDATA::getTextNormalize  )  [inline]
 

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.

Returns:
normalized cdata content or empty string

String org::jdom::CDATA::getTextTrim  )  [inline]
 

This returns the textual content with all surrounding whitespace removed. If only whitespace exists, the empty string is returned.

Returns:
trimmed cdata content or empty string

final int org::jdom::CDATA::hashCode  )  [inline]
 

This will generate a hash code for this node.

Returns:
int - hash code for this node.

CDATA org::jdom::CDATA::setParent Element  parent  )  [inline, protected]
 

This will set the parent of the CDATA node to the supplied 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 clone and set it on the desired (new) parent Element.

Parameters:
parent parent for this node.

CDATA org::jdom::CDATA::setText String  str  )  [inline]
 

This will set the value of this CDATA node.

Parameters:
str value for node's content.

String org::jdom::CDATA::toString  )  [inline]
 

This returns a String representation of the CDATA node, suitable for debugging. If the XML representation of the CDATA node is desired, either getText or org.jdom.output.XMLOutputter#output(CDATA, Writer) should be used.

Returns:
String - information about this node.


Member Data Documentation

Element org::jdom::CDATA::parent [protected]
 

This CDATA node's parent.

String org::jdom::CDATA::value [protected]
 

The actual character content


The documentation for this class was generated from the following file:
Generated on Tue Aug 17 16:06:29 2004 for JDOM by doxygen 1.3.7