All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.jdom.Text

java.lang.Object
   |
   +----org.jdom.Text

public class Text
extends Object
implements Serializable, Cloneable

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

Version:
1.0
Author:
Brett McLaughlin

Variable Index

 o parent
This Text node's parent.
 o value
The actual character content

Constructor Index

 o Text()

This is the protected, no-args constructor standard in all JDOM classes.

 o Text(String)

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

Method Index

 o append(String)

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

 o clone()

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

 o equals(Object)

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

 o getDocument()

This retrieves the owning {

 o getParent()

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

 o getValue()

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

 o hashCode()

This will generate a hash code for this node.

 o setValue(String)

This will set the value of this Text node.

 o toString()

This returns a String representation of the Text node, suitable for debugging.

Variables

 o value
 protected StringBuffer value
The actual character content

 o parent
 protected Element parent
This Text node's parent.

Constructors

 o Text
 protected Text()

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

 o Text
 public Text(String stringValue)

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

Parameters:
stringValue - the node's character content.

Methods

 o getValue
 public String getValue()

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

Returns:
String - character content of this node.
 o setValue
 public void setValue(String stringValue)

This will set the value of this Text node.

Parameters:
stringValue - value for node's content.
 o append
 public void append(String stringValue)

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

Parameters:
stringValue - character content to append.
 o getParent
 public Element getParent()

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

Returns:
Element - this node's parent.
 o getDocument
 public Document getDocument()

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

Returns:
Document owning this Text, or null.
 o toString
 public String toString()

This returns a String representation of the Text node, suitable for debugging. If the XML representation of the Text node is desired, either {@link #getValue} or {@link org.jdom.output.XMLOutputter#output(Text, Writer)} should be used.

Returns:
String - information about this node.
Overrides:
toString in class Object
 o hashCode
 public final int hashCode()

This will generate a hash code for this node.

Returns:
int - hash code for this node.
Overrides:
hashCode in class Object
 o clone
 public Object clone()

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

Returns:
Text - cloned node.
Overrides:
clone in class Object
 o equals
 public final boolean equals(Object ob)

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
Overrides:
equals in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index