de.pdark.decentxml
Class Text

java.lang.Object
  extended by de.pdark.decentxml.BasicNode
      extended by de.pdark.decentxml.Text
All Implemented Interfaces:
Node, TextNode

public class Text
extends BasicNode
implements TextNode


Constructor Summary
Text(java.lang.String text)
           
Text(Token token)
           
Text(XMLTokenizer.Type type, java.lang.String text)
           
 
Method Summary
 Text copy()
          Simulate clone()
 BasicNode copy(Node orig)
          Copy all data from orig into this
 Text createClone()
          Simulate clone()
 java.lang.String getNormalizedText()
          Get the contents of this text node without all whitespace before and after and with all whitespace between the words in the node reduced to a single space.
 java.lang.String getText()
          Get the text from the node
 java.lang.String getTrimmedText()
          Get the contents of this text node without all whitespace before and after
 boolean isCDATA()
           
 boolean isWhitespace()
          True, if this text node contains only whitespace
 Text setText(java.lang.String text)
          Change the text of the node.
 
Methods inherited from class de.pdark.decentxml.BasicNode
getEndOffset, getStartOffset, getToken, getType, getValue, setType, setValue, toString, toXML, toXML, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Text

public Text(Token token)

Text

public Text(XMLTokenizer.Type type,
            java.lang.String text)

Text

public Text(java.lang.String text)
Method Detail

isCDATA

public boolean isCDATA()

getText

public java.lang.String getText()
Description copied from interface: TextNode
Get the text from the node

Specified by:
getText in interface TextNode

setText

public Text setText(java.lang.String text)
Description copied from interface: TextNode
Change the text of the node. When necessary, the text will be escaped before writing it to the output stream.

Specified by:
setText in interface TextNode

getTrimmedText

public java.lang.String getTrimmedText()
Get the contents of this text node without all whitespace before and after


getNormalizedText

public java.lang.String getNormalizedText()
Get the contents of this text node without all whitespace before and after and with all whitespace between the words in the node reduced to a single space.


isWhitespace

public boolean isWhitespace()
True, if this text node contains only whitespace


createClone

public Text createClone()
Description copied from interface: Node
Simulate clone()

Specified by:
createClone in interface Node
Overrides:
createClone in class BasicNode

copy

public BasicNode copy(Node orig)
Description copied from interface: Node
Copy all data from orig into this

Specified by:
copy in interface Node
Overrides:
copy in class BasicNode

copy

public Text copy()
Description copied from interface: Node
Simulate clone()

Specified by:
copy in interface Node
Overrides:
copy in class BasicNode


Copyright © 2008-2011. All Rights Reserved.