com.novell.xml.xpath
Class NodeType

java.lang.Object
  extended bycom.novell.xml.xpath.NodeType
All Implemented Interfaces:
NodeTest
Direct Known Subclasses:
NodeTypePI

public class NodeType
extends Object
implements NodeTest

Class that represents a NodeType NodeTest in an XPath expression.

See Also:
NodeTypePI

Constructor Summary
protected NodeType(int type)
           
  NodeType(NodeTypeToken token)
          Construct a NodeType object based on the lexical token
 
Method Summary
 boolean evaluate(Node node)
          Evaluate the NodeTest with respect to the expression context
 int getNodeType()
          Return type of NodeType (comment, node, pi, text)
 String toString()
          Provide a readable description for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeType

public NodeType(NodeTypeToken token)
Construct a NodeType object based on the lexical token

Parameters:
token - Node type token

NodeType

protected NodeType(int type)
Method Detail

getNodeType

public int getNodeType()
Return type of NodeType (comment, node, pi, text)

Returns:
NodeTypeToken.COMMENT, NodeTypeToken.NODE, NodeTypeToken.PI, or NodeTypeToken.TEXT

toString

public String toString()
Provide a readable description for debugging.

Returns:
String representation

evaluate

public boolean evaluate(Node node)
Evaluate the NodeTest with respect to the expression context

Specified by:
evaluate in interface NodeTest
Parameters:
node - node to evaluate
Returns:
true if context Node is matched by NodeTest, false otherwise