|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.pattern.Pattern
A Pattern represents the result of parsing an XSLT pattern string.
Patterns are created by calling the static method Pattern.make(string).
The pattern is used to test a particular node by calling match().
Field Summary | |
protected String |
originalText
|
Constructor Summary | |
Pattern()
|
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. |
int |
getFingerprint()
Determine the name fingerprint of nodes to which this pattern applies. |
int |
getLineNumber()
Get the line number on which the pattern was defined |
int |
getNodeKind()
Determine the types of nodes to which this pattern applies. |
abstract NodeTest |
getNodeTest()
Get a NodeTest that all the nodes matching this pattern must satisfy |
String |
getSystemId()
Get the system id of the entity in which the pattern occurred |
protected boolean |
internalMatches(NodeInfo node,
Controller controller)
Determine whether this Pattern matches the given Node. |
static Pattern |
make(String pattern,
StaticContext env)
Static method to make a Pattern by parsing a String. |
abstract boolean |
matches(NodeInfo node,
Controller controller)
Determine whether this Pattern matches the given Node. |
void |
setLineNumber(int lineNumber)
Set the line number where the pattern occurred |
void |
setOriginalText(String text)
Set the original text of the pattern for use in diagnostics |
void |
setSystemId(String systemId)
Set the system ID where the pattern occurred |
Pattern |
simplify()
Simplify the pattern by applying any context-independent optimisations. |
String |
toString()
Get the original pattern text |
Pattern |
typeCheck(StaticContext env)
Type-check the pattern. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected String originalText
Constructor Detail |
public Pattern()
Method Detail |
public static Pattern make(String pattern, StaticContext env) throws XPathException
pattern
- The pattern text as a Stringenv
- An object defining the compile-time context for the expression
XPathException
public void setOriginalText(String text)
public Pattern simplify() throws XPathException
XPathException
public Pattern typeCheck(StaticContext env) throws XPathException
XPathException
public void setSystemId(String systemId)
public void setLineNumber(int lineNumber)
public abstract boolean matches(NodeInfo node, Controller controller) throws XPathException
node
- The NodeInfo representing the Element or other node to be tested against the Patterncontroller
- The controller. Only relevant if the pattern
uses variables, or contains calls on functions such as document() or key().
XPathException
protected boolean internalMatches(NodeInfo node, Controller controller) throws XPathException
node
- The NodeInfo representing the Element or other node to be tested against the Patterncontroller
- The controller. Only relevant if the pattern
uses variables, or contains calls on functions such as document() or key().
XPathException
public int getNodeKind()
public int getFingerprint()
public abstract NodeTest getNodeTest()
public double getDefaultPriority()
public String getSystemId()
public int getLineNumber()
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |