com.novell.xml.xpath
Class Token

java.lang.Object
  extended bycom.novell.xml.xpath.Token
Direct Known Subclasses:
AxisNameToken, FunctionNameToken, LiteralToken, NodeTypeToken, NumberToken, OperatorToken, VariableRefToken, WildcardNameToken

public class Token
extends Object

Basic lexical token class for breaking apart an XPath expression into tokens

See Also:
Scanner

Field Summary
static int AT
           
static int AXIS_NAME
           
static int COLON_COLON
           
static int COMMA
           
static int DOT
           
static int DOT_DOT
           
static int FUNCTION_NAME
           
static int LEFT_BRACKET
           
static int LEFT_PAREN
           
static int LITERAL
           
static int MAX_TYPE
           
static int NODE_TYPE
           
static int NOT_A_TOKEN
           
static int NUMBER
           
static int OPERATOR
           
static int RIGHT_BRACKET
           
static int RIGHT_PAREN
           
static int VARIABLE_REF
           
static int WILDCARD_NAME
           
 
Constructor Summary
Token(int t)
          Construct a XPath expression token with passed type
 
Method Summary
 void dump(PrintWriter out, int indent)
          Output this token as a string for debugging purposes
 boolean equals(Token rhs)
          Compare this token with another.
 int getType()
          Return token type
 String toString()
          Return a text representation of this Token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOT_A_TOKEN

public static final int NOT_A_TOKEN
See Also:
Constant Field Values

LEFT_PAREN

public static final int LEFT_PAREN
See Also:
Constant Field Values

RIGHT_PAREN

public static final int RIGHT_PAREN
See Also:
Constant Field Values

LEFT_BRACKET

public static final int LEFT_BRACKET
See Also:
Constant Field Values

RIGHT_BRACKET

public static final int RIGHT_BRACKET
See Also:
Constant Field Values

DOT

public static final int DOT
See Also:
Constant Field Values

DOT_DOT

public static final int DOT_DOT
See Also:
Constant Field Values

AT

public static final int AT
See Also:
Constant Field Values

COMMA

public static final int COMMA
See Also:
Constant Field Values

COLON_COLON

public static final int COLON_COLON
See Also:
Constant Field Values

OPERATOR

public static final int OPERATOR
See Also:
Constant Field Values

WILDCARD_NAME

public static final int WILDCARD_NAME
See Also:
Constant Field Values

NODE_TYPE

public static final int NODE_TYPE
See Also:
Constant Field Values

FUNCTION_NAME

public static final int FUNCTION_NAME
See Also:
Constant Field Values

AXIS_NAME

public static final int AXIS_NAME
See Also:
Constant Field Values

LITERAL

public static final int LITERAL
See Also:
Constant Field Values

NUMBER

public static final int NUMBER
See Also:
Constant Field Values

VARIABLE_REF

public static final int VARIABLE_REF
See Also:
Constant Field Values

MAX_TYPE

public static final int MAX_TYPE
See Also:
Constant Field Values
Constructor Detail

Token

public Token(int t)
Construct a XPath expression token with passed type

Parameters:
t - type of token
Method Detail

getType

public int getType()
Return token type

Returns:
type of token

equals

public boolean equals(Token rhs)
Compare this token with another. Derived classes are expected to override this.

Parameters:
rhs - Token to compare against
Returns:
true if rhs token matches this token, false otherwise

toString

public String toString()
Return a text representation of this Token.

Returns:
String that represents this Token

dump

public void dump(PrintWriter out,
                 int indent)
Output this token as a string for debugging purposes

Parameters:
out - PrintWriter object to write to
indent - Count of tabs ('\t') characters to output before the string representation of the Token