org.jdom
Class Text
- Cloneable, Serializable
Character-based XML content. Provides a modular, parentable method of
representing text. Text makes no guarantees about the underlying textual
representation of character data, but does expose that data as a Java String.
$Revision: 1.24 $, $Date: 2004/02/27 11:32:57 $- Brett McLaughlin
- Jason Hunter
- Bradley S. Huffman
protected String | value- The actual character content
|
Text()- This is the protected, no-args constructor standard in all JDOM
classes.
|
Text(String str)- This constructor creates a new
Text node, with the
supplied string value as it's character content.
|
void | append(String str)- This will append character content to whatever content already
exists within this
Text node.
|
void | append(Text text)- This will append the content of another
Text node
to this node.
|
Object | clone()- This will return a clone of this
Text node, with the
same character content, but no parent.
|
String | getText()- This returns the value of this
Text node as a Java
String.
|
String | getTextNormalize()- This returns the textual content with all surrounding whitespace
removed and internal whitespace normalized to a single space.
|
String | getTextTrim()- This returns the textual content with all surrounding whitespace
removed.
|
String | getValue()- Returns the XPath 1.0 string value of this element, which is the
text itself.
|
static String | normalizeString(String str)- This returns a new string with all surrounding whitespace
removed and internal whitespace normalized to a single space.
|
Text | setText(String str)- This will set the value of this
Text node.
|
String | toString()- This returns a
String representation of the
Text node, suitable for debugging.
|
value
protected String value
The actual character content
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.
Text
public Text(String str)
This constructor creates a new Text node, with the
supplied string value as it's character content.
str - the node's character content.
append
public void append(String str)
This will append character content to whatever content already
exists within this Text node.
str - character content to append.
append
public void append(Text text)
This will append the content of another Text node
to this node.
text - Text node to append.
clone
public Object clone()
This will return a clone of this Text node, with the
same character content, but no parent.
- clone in interface Content
getText
public String getText()
This returns the value of this Text node as a Java
String.
String - character content of this node.
getTextNormalize
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.
- normalized text content or empty string
getTextTrim
public String getTextTrim()
This returns the textual content with all surrounding whitespace
removed. If only whitespace exists, the empty string is returned.
- trimmed text content or empty string
getValue
public String getValue()
Returns the XPath 1.0 string value of this element, which is the
text itself.
- getValue in interface Content
normalizeString
public static String normalizeString(String str)
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
str - string to be normalized.
- normalized string or empty string
setText
public Text setText(String str)
This will set the value of this Text node.
str - value for node's content.
- the object on which the method was invoked
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
getText() or
XMLOutputter.outputString(Text)
should be used.
String - information about this node.
Copyright B) 2004 Jason Hunter, Brett McLaughlin. All Rights Reserved.