| java.lang.Object com.caucho.xpath.pattern.AbstractPattern
All known Subclasses: com.caucho.xpath.pattern.NodeTypePattern, com.caucho.xpath.pattern.FilterPattern, com.caucho.xpath.pattern.NamespacePattern, com.caucho.xpath.pattern.Axis, com.caucho.xpath.pattern.FromExpr, com.caucho.xpath.pattern.NodePattern, com.caucho.xpath.pattern.NSNamePattern, com.caucho.xpath.pattern.UnionPattern,
AbstractPattern | abstract public class AbstractPattern (Code) | | A node selection pattern. AbstractPatterns represent compiled XPath node selectors.
They can be used to find nodes, select nodes, and test if a node matches
a pattern.
There are two types of patterns: select patterns and match patterns.
Select patterns match a node relative to another node.
find and select use select patterns.
Match patterns match a node in isolation. isMatch uses
match patterns.
|
Method Summary | |
public AbstractPattern | copyAxis() Returns the owning axis for the pattern. | public AbstractPattern | copyPosition() Returns the position matching pattern. | public int | count(Node node, Env env, AbstractPattern pattern) Returns the number of nodes in its context for a match pattern. | public NodeIterator | createNodeIterator(Node node, ExprEnvironment env, AbstractPattern pattern) Creates a new node iterator. | public Node | findAny(Node node, ExprEnvironment env) Find any node matching the pattern. | public Node | firstNode(Node node, ExprEnvironment env) Returns the first node in the selection order. | public String | getNodeName() Returns the name of the matching node or '*' if many nodes match. | public AbstractPattern | getParent() Returns the parent pattern. | protected String | getPrefix() For string conversion, returns the string prefix corresponding to
the parents. | public double | getPriority() Returns the pattern's default priority as defined by the XSLT draft. | public boolean | isAscending() Return true if the iterator is in document-order. | boolean | isSingleLevel() Returns true if the pattern returns nodes on a single level. | boolean | isSingleSelect() | public boolean | isStrictlyAscending() Returns true if the pattern is strictly ascending. | public boolean | isUnique() Returns true if the pattern's iterator returns unique nodes. | public Node | lastNode(Node node) Returns the last node in the selection order. | abstract public boolean | match(Node node, ExprEnvironment env) The core match function test if the pattern matches the node.
Parameters: node - the node to test Parameters: env - the variable environment. | public Node | nextNode(Node node, Node last) Returns the next node in the selection order. | public int | position(Node node, Env env, AbstractPattern pattern) Returns the position of the node in its context for a match pattern. | public NodeIterator | select(Node node, ExprEnvironment env) Returns an iterator selecting nodes in document order.
Parameters: node - the starting node. Parameters: env - the variable environment. | public NodeIterator | selectUnique(Node node, ExprEnvironment env) Returns an iterator selecting unique nodes. | public String | toPatternString() |
count | public int count(Node node, Env env, AbstractPattern pattern) throws XPathException(Code) | | Returns the number of nodes in its context for a match pattern.
Parameters: node - the current node Parameters: env - the variable environment Parameters: pattern - the position pattern the count of nodes in the match selection |
findAny | public Node findAny(Node node, ExprEnvironment env) throws XPathException(Code) | | Find any node matching the pattern.
Parameters: node - the current node Parameters: env - the xpath environment one of the matching nodes |
firstNode | public Node firstNode(Node node, ExprEnvironment env) throws XPathException(Code) | | Returns the first node in the selection order.
Parameters: node - the current node Parameters: variable - environment the first node |
getNodeName | public String getNodeName()(Code) | | Returns the name of the matching node or '*' if many nodes match.
The Xsl package uses this to speed template matching.
|
getPrefix | protected String getPrefix()(Code) | | For string conversion, returns the string prefix corresponding to
the parents.
|
getPriority | public double getPriority()(Code) | | Returns the pattern's default priority as defined by the XSLT draft.
|
isAscending | public boolean isAscending()(Code) | | Return true if the iterator is in document-order.
|
isSingleLevel | boolean isSingleLevel()(Code) | | Returns true if the pattern returns nodes on a single level.
|
isSingleSelect | boolean isSingleSelect()(Code) | | Returns true if the pattern selects a single node
|
isStrictlyAscending | public boolean isStrictlyAscending()(Code) | | Returns true if the pattern is strictly ascending.
|
isUnique | public boolean isUnique()(Code) | | Returns true if the pattern's iterator returns unique nodes.
|
lastNode | public Node lastNode(Node node)(Code) | | Returns the last node in the selection order.
Parameters: node - the current node the last node |
match | abstract public boolean match(Node node, ExprEnvironment env) throws XPathException(Code) | | The core match function test if the pattern matches the node.
Parameters: node - the node to test Parameters: env - the variable environment. true if the node matches the pattern. |
nextNode | public Node nextNode(Node node, Node last) throws XPathException(Code) | | Returns the next node in the selection order.
Parameters: node - the current node Parameters: last - the last node the next node |
position | public int position(Node node, Env env, AbstractPattern pattern) throws XPathException(Code) | | Returns the position of the node in its context for a match pattern.
Parameters: node - the current node Parameters: env - the variable environment Parameters: pattern - the position pattern the node's position. |
select | public NodeIterator select(Node node, ExprEnvironment env) throws XPathException(Code) | | Returns an iterator selecting nodes in document order.
Parameters: node - the starting node. Parameters: env - the variable environment. an iterator selecting nodes in document order. |
selectUnique | public NodeIterator selectUnique(Node node, ExprEnvironment env) throws XPathException(Code) | | Returns an iterator selecting unique nodes. The nodes are not
necessarily in document order.
Parameters: node - the starting node. Parameters: env - the variable environment. Parameters: context - the context node. an iterator selecting unique nodes. |
|
|