com.novell.xml.xpath
Class NodeTypeToken

java.lang.Object
  extended bycom.novell.xml.xpath.Token
      extended bycom.novell.xml.xpath.NodeTypeToken

public class NodeTypeToken
extends Token

Class representing an XPath NodeType token (comment, node, pi, text)

See Also:
Scanner

Field Summary
static int COMMENT
          Represents a "comment" node type token
static int NODE
          Represents a "node" node type token
static int NOT_NODE_TYPE
          Represents an invalid value (not a node type)
static int PI
          Represents a processing instruction ("processing-instruction") node type token
static int TEXT
          Represents a "text" node type token
 
Fields inherited from class com.novell.xml.xpath.Token
AT, AXIS_NAME, COLON_COLON, COMMA, DOT, DOT_DOT, FUNCTION_NAME, LEFT_BRACKET, LEFT_PAREN, LITERAL, MAX_TYPE, NODE_TYPE, NOT_A_TOKEN, NUMBER, OPERATOR, RIGHT_BRACKET, RIGHT_PAREN, VARIABLE_REF, WILDCARD_NAME
 
Constructor Summary
NodeTypeToken(int t)
          Construct a NodeType token with passed type
 
Method Summary
 boolean equals(Token rhs)
          Compare this Token to passed Token
 int getNodeType()
          return this Tokens node type value
static int getTypeFromName(String name)
          Return token type value based on NodeType string (i.e, return NodeTypeToken.COMMENT given "comment", etc.)
static String getTypeName(int type)
          Given a node type token value, return the associated text
 String toString()
          Return text representing this NodeTypeToken
 
Methods inherited from class com.novell.xml.xpath.Token
dump, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOT_NODE_TYPE

public static final int NOT_NODE_TYPE
Represents an invalid value (not a node type)

See Also:
Constant Field Values

COMMENT

public static final int COMMENT
Represents a "comment" node type token

See Also:
Constant Field Values

NODE

public static final int NODE
Represents a "node" node type token

See Also:
Constant Field Values

PI

public static final int PI
Represents a processing instruction ("processing-instruction") node type token

See Also:
Constant Field Values

TEXT

public static final int TEXT
Represents a "text" node type token

See Also:
Constant Field Values
Constructor Detail

NodeTypeToken

public NodeTypeToken(int t)
Construct a NodeType token with passed type

Parameters:
t - type (NodeTypeToken.COMMENT, NodeTypeToken.TEXT, etc.)
Method Detail

equals

public boolean equals(Token rhs)
Compare this Token to passed Token

Overrides:
equals in class Token
Parameters:
rhs - Token to compare against
Returns:
true if this Token equals rhs Token

toString

public String toString()
Return text representing this NodeTypeToken

Overrides:
toString in class Token
Returns:
String representing this Token

getNodeType

public int getNodeType()
return this Tokens node type value

Returns:
node type value (NodeTypeToken.TEXT, etc.)

getTypeName

public static String getTypeName(int type)
Given a node type token value, return the associated text

Parameters:
type - NodeTypeToken.COMMENT, NodeTypeToken.PI, etc.
Returns:
String representing node type ("comment", "text", "pi", etc.) or "" if passed value isn't valid

getTypeFromName

public static int getTypeFromName(String name)
Return token type value based on NodeType string (i.e, return NodeTypeToken.COMMENT given "comment", etc.)

Parameters:
name - string containing node type text
Returns:
Value of node type token, or NodeType.NOT_NODE_TYPE if passed string isn't valid node type