public class Pattern
extends java.lang.Object
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.
| Modifier and Type | Field and Description |
|---|---|
protected static java.util.logging.Logger |
log |
| Modifier and Type | Method and Description |
|---|---|
org.w3c.dom.Node |
find(org.w3c.dom.Node node)
Returns the first node matching the pattern.
|
org.w3c.dom.Node |
find(org.w3c.dom.Node node,
ExprEnvironment env)
Returns the first node matching the pattern.
|
AbstractPattern |
getPattern()
Returns the underlying pattern implementation.
|
boolean |
isMatch(org.w3c.dom.Node node)
Test if the node matches the pattern.
|
boolean |
isMatch(org.w3c.dom.Node node,
ExprEnvironment env)
Test if the node matches the pattern.
|
NodeIterator |
select(org.w3c.dom.Node node)
Selects all nodes matching the pattern.
|
NodeIterator |
select(org.w3c.dom.Node node,
ExprEnvironment env)
Selects all nodes matching the pattern.
|
java.lang.String |
toString() |
public org.w3c.dom.Node find(org.w3c.dom.Node node)
throws XPathException
node - node represented by '.' and start of match.XPathExceptionpublic org.w3c.dom.Node find(org.w3c.dom.Node node,
ExprEnvironment env)
throws XPathException
node - node represented by '.' and start of match.env - variable environment.XPathExceptionpublic NodeIterator select(org.w3c.dom.Node node) throws XPathException
node - node represented by '.' and start of match.XPathExceptionpublic NodeIterator select(org.w3c.dom.Node node, ExprEnvironment env) throws XPathException
context - node represented by '.' and start of match.env - variable environment.XPathExceptionpublic boolean isMatch(org.w3c.dom.Node node)
throws XPathException
node - node to testXPathExceptionpublic boolean isMatch(org.w3c.dom.Node node,
ExprEnvironment env)
throws XPathException
node - node to testenv - variable environment.XPathExceptionpublic AbstractPattern getPattern()
public java.lang.String toString()
toString in class java.lang.Object