Main Page   Packages   Namespace List   Class Hierarchy   Compound List   Compound Members  

Text Class Reference

List of all members.

Public Methods

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

Static Public Methods

String normalizeString (String str)

Protected Methods

 Text ()
Text setParent (Element parent)

Protected Attributes

String value
Element parent

Detailed Description

Text represents character-based content within an XML document represented by JDOM. It is intended to provide a modular, parentable method of representing that text. Additionally, Text makes no guarantees about the underlying textual representation of character data, but does expose that data as a Java String.

Author:
Brett McLaughlin , Bradley S. Huffman
Version:
Revision:
1.10
,
Date:
2002/01/26 07:57:37


Constructor & Destructor Documentation

Text::Text   [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.

Text::Text String    str [inline]
 

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

Parameters:
str  the node's character content.


Member Function Documentation

void Text::append Text    text [inline]
 

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

Parameters:
text  Text node to append.

void Text::append String    str [inline]
 

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

Parameters:
str  character content to append.

Object Text::clone   [inline]
 

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

Returns:
Text - cloned node.

Text Text::detach   [inline]
 

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

Returns:
Text - this Text modified.

final boolean Text::equals Object    ob [inline]
 

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

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

Document Text::getDocument   [inline]
 

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

Returns:
Document owning this Text, or null.

Element Text::getParent   [inline]
 

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

Returns:
Element - this node's parent.

String Text::getText   [inline]
 

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

Returns:
String - character content of this node.

String Text::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 text content or empty string

String Text::getTextTrim   [inline]
 

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

Returns:
trimmed text content or empty string

final int Text::hashCode   [inline]
 

This will generate a hash code for this node.

Returns:
int - hash code for this node.

String Text::normalizeString String    str [inline, static]
 

This returns a new string with all surrounding whitespace removed and internal whitespace normalized to a single space. If only whitespace exists, the empty string is returned.

Per XML 1.0 Production 3 whitespace includes: x20, x9, xD, xA

Parameters:
str  string to be normalized.
Returns:
normalized string or empty string

Text Text::setParent Element    parent [inline, protected]
 

This will set the parent of the Text 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 Text 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.

Text Text::setText String    str [inline]
 

This will set the value of this Text node.

Parameters:
str  value for node's content.

String Text::toString   [inline]
 

This returns a String representation of the Text node, suitable for debugging. If the XML representation of the Text node is desired, either getText or XMLOutputter::outputString should be used.

Returns:
String - information about this node.


Member Data Documentation

Element Text::parent [protected]
 

This Text node's parent.

String Text::value [protected]
 

The actual character content


The documentation for this class was generated from the following file:
Generated on Sat Mar 30 18:53:04 2002 for JDOM by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001