public final class LocationPathPattern extends Pattern
| Modifier and Type | Field and Description |
|---|---|
Pattern |
ancestorPattern |
protected Expression |
equivalentExpr |
protected Expression[] |
filters |
protected boolean |
firstElementPattern |
protected boolean |
lastElementPattern |
NodeTest |
nodeTest |
protected int |
numberOfFilters |
Pattern |
parentPattern |
protected boolean |
specialFilter |
originalText, staticContext| Constructor and Description |
|---|
LocationPathPattern() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFilter(Expression filter)
Add a filter to the pattern (while under construction)
|
int |
getFingerprint()
Determine the fingerprint of nodes to which this pattern applies.
|
short |
getNodeType()
Determine the types of nodes to which this pattern applies.
|
boolean |
isRelative()
Determine if the pattern uses positional filters
|
boolean |
matches(NodeInfo node,
Context context)
Determine whether this Pattern matches the given Node
|
boolean |
matchesX(NodeInfo node,
Context context)
Determine whether the pattern matches a given node.
|
Pattern |
simplify()
Simplify the pattern: perform any context-independent optimisations
|
getDefaultPriority, getLineNumber, getStaticContext, getSystemId, make, setOriginalText, setStaticContext, toStringpublic Pattern parentPattern
public Pattern ancestorPattern
public NodeTest nodeTest
protected Expression[] filters
protected int numberOfFilters
protected Expression equivalentExpr
protected boolean firstElementPattern
protected boolean lastElementPattern
protected boolean specialFilter
public void addFilter(Expression filter)
filter - The predicate (a boolean expression or numeric expression) to be addedpublic Pattern simplify() throws XPathException
simplify in class PatternXPathExceptionpublic boolean matchesX(NodeInfo node, Context context) throws XPathException
node - the node to be testedXPathExceptionpublic boolean matches(NodeInfo node, Context context) throws XPathException
Patternmatches in class Patternnode - The NodeInfo representing the Element or other node to be tested against the Patterncontext - The context in which the match is to take place. Only relevant if the pattern
uses variables.XPathExceptionpublic short getNodeType()
getNodeType in class Patternpublic int getFingerprint()
getFingerprint in class Patternpublic boolean isRelative()
throws XPathException
XPathException