scone.util.tokenstream
Class HtmlTextToken

java.lang.Object
  extended by scone.util.tokenstream.HtmlTextToken
All Implemented Interfaces:
Token

public class HtmlTextToken
extends java.lang.Object
implements Token

HTML text.

This is unformattet HTML text

Author:
Harald Weinreich, Volkert Buchmann

Field Summary
static java.lang.String COPYRIGHT
           
protected  java.lang.String text
          the text
protected  java.lang.String unescapedText
          the text without excaped characters like  
protected  java.lang.String whiteSpaces
          preceding whitespaces
 
Constructor Summary
HtmlTextToken(java.lang.String text)
          creates a HtmlTextToken
HtmlTextToken(java.lang.String text, java.lang.StringBuffer whiteSpaces)
          creates a HtmlTextToken
 
Method Summary
 void appendText(java.lang.String text)
          appends to the text
 Token getClone()
          returns a clone of this token
 java.lang.String getText()
          Returns the simple text of the token without whitespaces.
 java.lang.String getUnescapedText()
          Returns the token text with HTML escape sequences replaced with their character equivalents, e.g.
 java.lang.String getWhiteSpaces()
          returns the leading whitespaces
 void setText(java.lang.String text)
          changes the text
 void setWhiteSpaces(java.lang.String whiteSpaces)
          changes the whitespaces
 java.lang.String toString()
          returns a String representation of this Token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

whiteSpaces

protected java.lang.String whiteSpaces
preceding whitespaces


text

protected java.lang.String text
the text


unescapedText

protected java.lang.String unescapedText
the text without excaped characters like  

Constructor Detail

HtmlTextToken

public HtmlTextToken(java.lang.String text,
                     java.lang.StringBuffer whiteSpaces)
creates a HtmlTextToken

Parameters:
text - the text
whiteSpaces - leading whitespaces (see the toString() method)

HtmlTextToken

public HtmlTextToken(java.lang.String text)
creates a HtmlTextToken

Parameters:
text - the text
Method Detail

getClone

public Token getClone()
returns a clone of this token

Specified by:
getClone in interface Token
Returns:
the clone

getText

public java.lang.String getText()
Returns the simple text of the token without whitespaces.

Returns:
a text string

getUnescapedText

public java.lang.String getUnescapedText()
Returns the token text with HTML escape sequences replaced with their character equivalents, e.g. © becomes ©.

Returns:
a string with all HTML escape sequences removed

setText

public void setText(java.lang.String text)
changes the text

Parameters:
text - the new text

appendText

public void appendText(java.lang.String text)
appends to the text

Parameters:
text - the text to append

toString

public java.lang.String toString()
returns a String representation of this Token.

Overrides:
toString in class java.lang.Object
Returns:
whiteSpaces+text

getWhiteSpaces

public java.lang.String getWhiteSpaces()
returns the leading whitespaces

Returns:
the whitespaces

setWhiteSpaces

public void setWhiteSpaces(java.lang.String whiteSpaces)
changes the whitespaces

Parameters:
whiteSpaces - the new whitespaces