com.icl.saxon.pattern
public abstract class Pattern extends Object
Field Summary | |
---|---|
protected String | originalText |
protected StaticContext | staticContext |
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 |
short | getNodeType()
Determine the types of nodes to which this pattern applies. |
StaticContext | getStaticContext()
Determine the static context used when the pattern was parsed |
String | getSystemId()
Get the system id of the entity in which the pattern occurred |
static Pattern | make(String pattern, StaticContext env)
Static method to make a Pattern by parsing a String. |
abstract boolean | matches(NodeInfo node, Context context)
Determine whether this Pattern matches the given Node |
void | setOriginalText(String text)
Set the original text of the pattern for use in diagnostics |
void | setStaticContext(StaticContext sc)
Set the static context used when the pattern was parsed |
Pattern | simplify()
Simplify the pattern by applying any context-independent optimisations.
|
String | toString()
Get the original pattern text |
Returns: A fingerprint that the nodes must match, or null Otherwise return null.
Returns: the type of node matched by this pattern. e.g. NodeInfo.ELEMENT or NodeInfo.TEXT
Parameters: pattern The pattern text as a String env An object defining the compile-time context for the expression
Returns: The pattern object
Parameters: node The NodeInfo representing the Element or other node to be tested against the Pattern context The context in which the match is to take place. Only relevant if the pattern uses variables.
Returns: true if the node matches the Pattern, false otherwise
Returns: the optimised Pattern