public final class KeyPattern extends NodeSetPattern
expression, itemType
Constructor and Description |
---|
KeyPattern(StructuredQName keyName,
Expression key,
Configuration config)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Pattern |
analyze(ExpressionVisitor visitor,
ItemType contextItemType)
Type-check the pattern.
|
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, getNodeKind, 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 KeyPattern(StructuredQName keyName, Expression key, Configuration config)
keyName
- the name of the keykey
- the value of the key: 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 NodeTest getNodeTest()
getNodeTest
in class NodeSetPattern