|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.caucho.xpath.pattern.AbstractPattern
public abstract class AbstractPattern
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.
Field Summary | |
---|---|
protected AbstractPattern |
_child
|
protected AbstractPattern |
_parent
|
protected static java.util.logging.Logger |
log
|
static java.lang.String |
XMLNS
|
Method Summary | |
---|---|
AbstractPattern |
copyAxis()
Returns the owning axis for the pattern. |
AbstractPattern |
copyPosition()
Returns the position matching pattern. |
int |
count(org.w3c.dom.Node node,
Env env,
AbstractPattern pattern)
Returns the number of nodes in its context for a match pattern. |
NodeIterator |
createNodeIterator(org.w3c.dom.Node node,
ExprEnvironment env,
AbstractPattern pattern)
Creates a new node iterator. |
org.w3c.dom.Node |
findAny(org.w3c.dom.Node node,
ExprEnvironment env)
Find any node matching the pattern. |
org.w3c.dom.Node |
firstNode(org.w3c.dom.Node node,
ExprEnvironment env)
Returns the first node in the selection order. |
java.lang.String |
getNodeName()
Returns the name of the matching node or '*' if many nodes match. |
AbstractPattern |
getParent()
Returns the parent pattern. |
protected java.lang.String |
getPrefix()
For string conversion, returns the string prefix corresponding to the parents. |
double |
getPriority()
Returns the pattern's default priority as defined by the XSLT draft. |
boolean |
isAscending()
Return true if the iterator is in document-order. |
boolean |
isStrictlyAscending()
Returns true if the pattern is strictly ascending. |
boolean |
isUnique()
Returns true if the pattern's iterator returns unique nodes. |
org.w3c.dom.Node |
lastNode(org.w3c.dom.Node node)
Returns the last node in the selection order. |
abstract boolean |
match(org.w3c.dom.Node node,
ExprEnvironment env)
The core match function test if the pattern matches the node. |
org.w3c.dom.Node |
nextNode(org.w3c.dom.Node node,
org.w3c.dom.Node last)
Returns the next node in the selection order. |
int |
position(org.w3c.dom.Node node,
Env env,
AbstractPattern pattern)
Returns the position of the node in its context for a match pattern. |
NodeIterator |
select(org.w3c.dom.Node node,
ExprEnvironment env)
Returns an iterator selecting nodes in document order. |
NodeIterator |
selectUnique(org.w3c.dom.Node node,
ExprEnvironment env)
Returns an iterator selecting unique nodes. |
java.lang.String |
toPatternString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.util.logging.Logger log
public static final java.lang.String XMLNS
protected AbstractPattern _parent
protected AbstractPattern _child
Method Detail |
---|
public AbstractPattern getParent()
public double getPriority()
public java.lang.String getNodeName()
The Xsl package uses this to speed template matching.
public NodeIterator select(org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
node
- the starting node.env
- the variable environment.
XPathException
public NodeIterator selectUnique(org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
node
- the starting node.env
- the variable environment.context
- the context node.
XPathException
public org.w3c.dom.Node findAny(org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
node
- the current nodeenv
- the xpath environment
XPathException
public boolean isStrictlyAscending()
public boolean isUnique()
public NodeIterator createNodeIterator(org.w3c.dom.Node node, ExprEnvironment env, AbstractPattern pattern) throws XPathException
node
- the starting nodeenv
- the variable environmentpattern
- the level pattern
XPathException
public org.w3c.dom.Node firstNode(org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
node
- the current nodevariable
- environment
XPathException
public org.w3c.dom.Node lastNode(org.w3c.dom.Node node)
node
- the current node
public org.w3c.dom.Node nextNode(org.w3c.dom.Node node, org.w3c.dom.Node last) throws XPathException
node
- the current nodelast
- the last node
XPathException
public abstract boolean match(org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
node
- the node to testenv
- the variable environment.
XPathException
public boolean isAscending()
public int position(org.w3c.dom.Node node, Env env, AbstractPattern pattern) throws XPathException
node
- the current nodeenv
- the variable environmentpattern
- the position pattern
XPathException
public int count(org.w3c.dom.Node node, Env env, AbstractPattern pattern) throws XPathException
node
- the current nodeenv
- the variable environmentpattern
- the position pattern
XPathException
public AbstractPattern copyAxis()
public AbstractPattern copyPosition()
protected java.lang.String getPrefix()
public java.lang.String toPatternString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |