|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saxon.pattern.Pattern | +--net.sf.saxon.pattern.LocationPathPattern
A LocationPathPattern represents a path, for example of the form A/B/C... The components are represented as a linked list, each component pointing to its predecessor
Field Summary | |
Pattern |
ancestorPattern
|
protected Expression |
equivalentExpr
|
protected Expression[] |
filters
|
protected boolean |
firstElementPattern
|
protected boolean |
lastElementPattern
|
NodeTest |
nodeTest
|
protected int |
numberOfFilters
|
Pattern |
parentPattern
|
protected boolean |
specialFilter
|
Constructor Summary | |
LocationPathPattern()
|
Method Summary | |
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. |
int |
getNodeKind()
Determine the types of nodes to which this pattern applies. |
NodeTest |
getNodeTest()
Get a NodeTest that all the nodes matching this pattern must satisfy |
protected boolean |
internalMatches(NodeInfo node,
XPathContext context)
Test whether the pattern matches, but without changing the current() node |
boolean |
matches(NodeInfo node,
XPathContext context)
Determine whether this Pattern matches the given Node. |
boolean |
matchesX(NodeInfo node,
XPathContext context)
Determine whether the pattern matches a given node. |
Pattern |
simplify(StaticContext env)
Simplify the pattern: perform any context-independent optimisations |
Pattern |
typeCheck(StaticContext env,
ItemType contextItemType)
Type-check the pattern, performing any type-dependent optimizations. |
Methods inherited from class net.sf.saxon.pattern.Pattern |
getColumnNumber, getDefaultPriority, getExecutable, getLineNumber, getPublicId, getSystemId, make, setExecutable, setLineNumber, setOriginalText, setSystemId, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public 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
Constructor Detail |
public LocationPathPattern()
Method Detail |
public void addFilter(Expression filter)
filter
- The predicate (a boolean expression or numeric expression) to be addedpublic Pattern simplify(StaticContext env) throws XPathException
simplify
in class Pattern
XPathException
public Pattern typeCheck(StaticContext env, ItemType contextItemType) throws XPathException
typeCheck
in class Pattern
XPathException
public boolean matchesX(NodeInfo node, XPathContext context) throws XPathException
node
- the node to be tested
XPathException
public boolean matches(NodeInfo node, XPathContext context) throws XPathException
Pattern
matches
in class Pattern
node
- 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
protected boolean internalMatches(NodeInfo node, XPathContext context) throws XPathException
internalMatches
in class Pattern
node
- 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 Pattern
public int getFingerprint()
getFingerprint
in class Pattern
public NodeTest getNodeTest()
getNodeTest
in class Pattern
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |