public final class IDPattern extends NodeSetPattern
expression, itemType
Constructor and Description |
---|
IDPattern(Expression id,
Configuration config)
Create an id pattern.
|
Modifier and Type | Method and Description |
---|---|
Pattern |
analyze(ExpressionVisitor visitor,
ItemType contextItemType)
Type-check the pattern.
|
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,
XPathContext context)
Determine whether this Pattern matches the given Node
|
allocateSlots, equals, getDependencies, hashCode, iterateSubExpressions, promote, replaceSubExpression
getColumnNumber, getContainerGranularity, getDefaultPriority, getExecutable, getFingerprint, getHostLanguage, getLineNumber, getLocationProvider, getPublicId, getSystemId, internalMatches, make, makeSearchExpression, matchesBeneathAnchor, resolveCurrent, selectNodes, setExecutable, setLineNumber, setOriginalText, setSystemId, simplify, toString
public IDPattern(Expression id, Configuration config)
id
- Either a StringValue or a VariableReferencepublic Pattern analyze(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException
analyze
in class NodeSetPattern
visitor
- the expression visitorcontextItemType
- the type of the context item at the point where the pattern
is defined. Set to null if it is known that the context item is undefined.XPathException
public boolean matches(NodeInfo e, XPathContext context) throws XPathException
matches
in class NodeSetPattern
e
- The NodeInfo representing the Element or other node to be tested against the Patterncontext
- The dynamic context. Only relevant if the pattern
uses variables, or contains calls on functions such as document() or key().XPathException
public int getNodeKind()
getNodeKind
in class NodeSetPattern
public NodeTest getNodeTest()
getNodeTest
in class NodeSetPattern