Package org.dom4j.rule
Interface Pattern
- All Superinterfaces:
NodeFilter
- All Known Implementing Classes:
DefaultPattern
,NodeTypePattern
,XPathPattern
Pattern
defines the behaviour for pattern in the XSLT
processing model.
- Version:
- $Revision: 1.6 $
- Author:
- James Strachan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final short
Matches any nodestatic final double
According to the spec we should return 0.5 if we cannot determine the prioritystatic final short
Matches no nodesstatic final short
Count of the number of node types -
Method Summary
Modifier and TypeMethodDescriptionFor 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
DOCUMENT ME!double
Returns the default resolution policy of the pattern according to the XSLT conflict resolution spec .Pattern[]
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
DOCUMENT ME!
-
Field Details
-
ANY_NODE
static final short ANY_NODEMatches any node- See Also:
-
NONE
static final short NONEMatches no nodes- See Also:
-
NUMBER_OF_TYPES
static final short NUMBER_OF_TYPESCount of the number of node types- See Also:
-
DEFAULT_PRIORITY
static final double DEFAULT_PRIORITYAccording to the spec we should return 0.5 if we cannot determine the priority- See Also:
-
-
Method Details
-
matches
DOCUMENT ME!- Specified by:
matches
in interfaceNodeFilter
- Parameters:
node
- DOCUMENT ME!- Returns:
- true if the pattern matches the given DOM4J node.
-
getPriority
double getPriority()Returns the default resolution policy of the pattern according to the XSLT conflict resolution spec .- Returns:
- DOCUMENT ME!
-
getUnionPatterns
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. Otherwise this method should return null.- Returns:
- an array of the patterns which make up this union pattern or null if this pattern is not a union pattern
-
getMatchType
short getMatchType()DOCUMENT ME!- Returns:
- the type of node the pattern matches which by default should return ANY_NODE if it can match any kind of node.
-
getMatchesNodeName
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. This allows a more efficient rule matching algorithm to be performed, rather than a brute force approach of evaluating every pattern for a given Node.- Returns:
- the name of the element or attribute this pattern matches or null if this pattern matches any or more than one name.
-