com.icl.saxon.pattern
Class NodeTestPattern
java.lang.Object
|
+--com.icl.saxon.pattern.Pattern
|
+--com.icl.saxon.pattern.NodeTestPattern
- public class NodeTestPattern
- extends Pattern
A NodeTestPattern is a pattern consisting only of a NodeTest.
We optimise this as a special case.
Method Summary |
double |
getDefaultPriority()
Determine the default priority to use if this pattern appears as a match pattern
for a template with no explicit priority attribute. |
Name |
getName()
Determine the name of nodes to which this pattern applies. |
int |
getType()
Determine the type of nodes to which this pattern applies. |
boolean |
isRelative()
Determine if the pattern uses positional filters |
boolean |
matches(NodeInfo node,
Context c)
Determine whether the pattern matches a given node. |
java.lang.String |
toString()
Return the pattern as a string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NodeTestPattern
public NodeTestPattern(int nodeType)
- Constructor
- Parameters:
nodeType
- The type of node to be matched
matches
public boolean matches(NodeInfo node,
Context c)
throws org.xml.sax.SAXException
- Determine whether the pattern matches a given node.
- Overrides:
matches
in class Pattern
- Parameters:
node
- the ElementInfo or other node to be tested- Returns:
- true if the pattern matches, else false
getType
public int getType()
- Determine the type of nodes to which this pattern applies.
- Overrides:
getType
in class Pattern
- Returns:
- the node type
getName
public Name getName()
- Determine the name of nodes to which this pattern applies.
- Overrides:
getName
in class Pattern
- Returns:
- null (meaning any name or no name)
toString
public java.lang.String toString()
- Return the pattern as a string
- Overrides:
toString
in class java.lang.Object
isRelative
public boolean isRelative()
- Determine if the pattern uses positional filters
- Overrides:
isRelative
in class Pattern
- Returns:
- false always
getDefaultPriority
public double getDefaultPriority()
- Determine the default priority to use if this pattern appears as a match pattern
for a template with no explicit priority attribute.
- Overrides:
getDefaultPriority
in class Pattern