net.sf.saxon.pattern
Class IDPattern

java.lang.Object
  extended bynet.sf.saxon.pattern.Pattern
      extended bynet.sf.saxon.pattern.IDPattern
All Implemented Interfaces:
Serializable

public final class IDPattern
extends Pattern

An IDPattern is a pattern of the form id(literal)

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.pattern.Pattern
originalText
 
Constructor Summary
IDPattern(Expression id)
           
 
Method Summary
 int getNodeKind()
          Determine the type of nodes to which this pattern applies.
 NodeTest getNodeTest()
          Get a NodeTest that all the nodes matching this pattern must satisfy
 boolean matches(NodeInfo e, Controller controller)
          Determine whether this Pattern matches the given Node
 Pattern typeCheck(StaticContext env)
          Type-check the pattern.
 
Methods inherited from class net.sf.saxon.pattern.Pattern
getDefaultPriority, getFingerprint, getLineNumber, getSystemId, internalMatches, make, setLineNumber, setOriginalText, setSystemId, simplify, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IDPattern

public IDPattern(Expression id)
Method Detail

typeCheck

public Pattern typeCheck(StaticContext env)
                  throws XPathException
Type-check the pattern. Default implementation does nothing. This is only needed for patterns that contain variable references or function calls.

Overrides:
typeCheck in class Pattern
Returns:
the optimised Pattern
Throws:
XPathException

matches

public boolean matches(NodeInfo e,
                       Controller controller)
                throws XPathException
Determine whether this Pattern matches the given Node

Specified by:
matches in class Pattern
Parameters:
e - The NodeInfo representing the Element or other node to be tested against the Pattern
controller - The controller. Only relevant if the pattern uses variables, or contains calls on functions such as document() or key().
Returns:
true if the node matches the Pattern, false otherwise
Throws:
XPathException

getNodeKind

public int getNodeKind()
Determine the type of nodes to which this pattern applies.

Overrides:
getNodeKind in class Pattern
Returns:
Type.ELEMENT

getNodeTest

public NodeTest getNodeTest()
Get a NodeTest that all the nodes matching this pattern must satisfy

Specified by:
getNodeTest in class Pattern