Class NodeTest
java.lang.Object
com.icl.saxon.pattern.Pattern
com.icl.saxon.pattern.NodeTest
- Direct Known Subclasses:
AnyChildNodePattern, AnyNodeTest, NamespaceTest, NameTest, NodeTypeTest, NoNodeTest
A NodeTest is a simple kind of pattern that enables a context-free test of whether
a node has a particular
name. There are five kinds of name test: a full name test, a prefix test, and an
"any node of a given type" test, an "any node of any type" test, and a "no nodes"
test (used, e.g. for "@comment()")
- Author:
- Michael H. Kay
-
Field Summary
Fields inherited from class Pattern
originalText, staticContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanmatches(short nodeType, int fingerprint) Test whether this node test is satisfied by a given nodeabstract booleanTest whether this node test is satisfied by a given nodefinal booleanTest whether this node test is satisfied by a given node, in a given ContextMethods inherited from class Pattern
getDefaultPriority, getFingerprint, getLineNumber, getNodeType, getStaticContext, getSystemId, make, setOriginalText, setStaticContext, simplify, toString
-
Constructor Details
-
NodeTest
public NodeTest()
-
-
Method Details
-
matches
Test whether this node test is satisfied by a given node -
matches
public abstract boolean matches(short nodeType, int fingerprint) Test whether this node test is satisfied by a given node- Parameters:
nodeType- The type of node to be matchedfingerprint- identifies the expanded name of the node to be matched. The value should be -1 for a node with no name.
-
matches
Test whether this node test is satisfied by a given node, in a given Context- Specified by:
matchesin classPattern- Parameters:
node- The NodeInfo representing the Element or other node to be tested against the Patternc- The context in which the match is to take place. Only relevant if the pattern uses variables.- Returns:
- true if the node matches the Pattern, false otherwise
-