xtc.tree
Class TextToken

java.lang.Object
  extended by xtc.tree.Node
      extended by xtc.tree.Token
          extended by xtc.tree.TextToken
All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>, Locatable

public class TextToken
extends Token

A token with an explicit text.

Version:
$Revision: 1.1 $
Author:
Robert Grimm

Constructor Summary
TextToken(java.lang.String text)
          Create a new text token.
 
Method Summary
 java.lang.String getTokenText()
          Treat this node as a token and get its text.
 
Methods inherited from class xtc.tree.Token
cast, get, hasTraversal, isToken, set, size, test, toToken
 
Methods inherited from class xtc.tree.Node
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, getBoolean, getBooleanProperty, getGeneric, getList, getLocation, getName, getNode, getProperty, getString, getStringProperty, hasLocation, hasName, hasProperty, hasVariable, indexOf, isAnnotation, isEmpty, isGeneric, isList, iterator, lastIndexOf, properties, remove, removeProperty, setLocation, setLocation, setProperty, strip, toAnnotation, toList, toString, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextToken

public TextToken(java.lang.String text)
Create a new text token.

Parameters:
text - The text.
Method Detail

getTokenText

public java.lang.String getTokenText()
Description copied from class: Node
Treat this node as a token and get its text. This method strips away any annotations, treats the resulting node as a token, and returns its text. User-specified classes must not override this method.

Specified by:
getTokenText in class Token
Returns:
The token's text.
See Also:
Node.strip()


Copyright © 2012. All Rights Reserved.