public class DefaultPattern extends Object implements Pattern
DefaultPattern
a default implementation of Pattern
which can take any XPath implementation or NodeFilter for defining the pattern.
WARNING this implementation causes a worst case, brute force XSLT
rule evaluation to be performed.
Wherever possible the methods
getPriority()
,
getMatchType()
and
getMatchesNodeName()
should be overloaded to allow more rule filtering to occur.
Modifier and Type | Field and Description |
---|---|
private NodeFilter |
filter |
ANY_NODE, DEFAULT_PRIORITY, NONE, NUMBER_OF_TYPES
Constructor and Description |
---|
DefaultPattern(NodeFilter filter) |
Modifier and Type | Method and Description |
---|---|
String |
getMatchesNodeName()
For patterns which only match an ATTRIBUTE_NODE or an
ELEMENT_NODE then this pattern may return the name of the
element or attribute it matches.
|
short |
getMatchType() |
double |
getPriority()
Returns the default resolution policy of the pattern according to the
XSLT conflict resolution spec.
|
Pattern[] |
getUnionPatterns()
If this pattern is a union pattern then this
method should return an array of patterns which
describe the union pattern, which should contain more than one pattern.
|
boolean |
matches(Node node)
matches returns true if the given node matches
the filter condition. |
private NodeFilter filter
public DefaultPattern(NodeFilter filter)
public boolean matches(Node node)
NodeFilter
matches
returns true if the given node matches
the filter condition.
matches
in interface NodeFilter
matches
in interface Pattern
public double getPriority()
Pattern
getPriority
in interface Pattern
public Pattern[] getUnionPatterns()
Pattern
getUnionPatterns
in interface Pattern
public short getMatchType()
getMatchType
in interface Pattern
public String getMatchesNodeName()
Pattern
getMatchesNodeName
in interface Pattern
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses