| java.lang.Object org.jdom.Content org.jdom.Text
All known Subclasses: org.jdom.CDATA,
Text | public class Text extends Content (Code) | | 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.
version: $Revision: 1.1 $, $Date: 2005/04/27 09:32:40 $ author: Brett McLaughlin author: Jason Hunter author: Bradley S. Huffman |
Constructor Summary | |
protected | Text() This is the protected, no-args constructor standard in all JDOM
classes. | public | Text(String str) This constructor creates a new Text node, with the
supplied string value as it's character content. |
Method Summary | |
public void | append(String str) This will append character content to whatever content already
exists within this Text node. | public void | append(Text text) This will append the content of another Text node
to this node. | public Object | clone() This will return a clone of this Text node, with the
same character content, but no parent. | public String | getText() This returns the value of this Text node as a Java
String . | public String | getTextNormalize() This returns the textual content with all surrounding whitespace
removed and internal whitespace normalized to a single space. | public String | getTextTrim() This returns the textual content with all surrounding whitespace
removed. | public String | getValue() Returns the XPath 1.0 string value of this element, which is the
text itself. | public static String | normalizeString(String str) This returns a new string with all surrounding whitespace
removed and internal whitespace normalized to a single space. | public Text | setText(String str) This will set the value of this Text node.
Parameters: str - value for node's content. | public String | toString() This returns a String representation of the
Text node, suitable for debugging. |
value | protected String value(Code) | | The actual character content
|
Text | protected Text()(Code) | | This is the protected, no-args constructor standard in all JDOM
classes. It allows subclassers to get a raw instance with no
initialization.
|
append | public void append(Text text)(Code) | | This will append the content of another Text node
to this node.
Parameters: text - Text node to append. |
clone | public Object clone()(Code) | | This will return a clone of this Text node, with the
same character content, but no parent.
Text - cloned node. |
getText | public String getText()(Code) | | This returns the value of this Text node as a Java
String .
String - character content of this node. |
getTextNormalize | public String getTextNormalize()(Code) | | 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()(Code) | | 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()(Code) | | Returns the XPath 1.0 string value of this element, which is the
text itself.
the text |
normalizeString | public static String normalizeString(String str)(Code) | | 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. normalized string or empty string |
|
|