public class AnchorPattern extends Pattern
| Constructor and Description |
|---|
AnchorPattern() |
| Modifier and Type | Method and Description |
|---|---|
Pattern |
analyze(ExpressionVisitor visitor,
ContextItemStaticInfo contextItemType)
Type-check the pattern.
|
ItemType |
getItemType()
Get a NodeTest that all the nodes matching this pattern must satisfy
|
int |
getNodeKindMask()
Get a mask indicating which kinds of nodes this NodeTest can match.
|
boolean |
matches(Item item,
XPathContext context)
Determine whether this Pattern matches the given Node.
|
boolean |
matchesBeneathAnchor(NodeInfo node,
NodeInfo anchor,
XPathContext context)
Determine whether this pattern matches a given Node within the subtree rooted at a given
anchor node.
|
String |
toString()
Get the original pattern text
|
allocateSlots, bindCurrent, convertToTypedPattern, getColumnNumber, getConfiguration, getContainerGranularity, getDefaultPriority, getDependencies, getFingerprint, getHostLanguage, getLineNumber, getLocationProvider, getNodeKind, getPackageData, getPublicId, getSystemId, isMotionless, iterateSubExpressions, make, promote, replaceCurrent, replaceSubExpression, selectNodes, setLineNumber, setOriginalText, setPackageData, setPriority, setSystemId, simplifypublic int getNodeKindMask()
getNodeKindMask in class Patternpublic Pattern analyze(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException
analyze in class Patternvisitor - 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.XPathExceptionpublic boolean matchesBeneathAnchor(NodeInfo node, NodeInfo anchor, XPathContext context) throws XPathException
matchesBeneathAnchor in class Patternnode - The NodeInfo representing the Element or other node to be tested against the Patternanchor - The anchor node, which must match any AnchorPattern subpatterncontext - The dynamic context. Only relevant if the pattern
uses variables, or contains calls on functions such as document() or key().XPathException - if an error occurs while matching the pattern (the caller will usually
treat this the same as a false result)public boolean matches(Item item, XPathContext context) throws XPathException
matches in class Patternitem - 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 - if an error occurs while matching the pattern (the caller will usually
treat this the same as a false result)public ItemType getItemType()
getItemType in class PatternCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.