|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.swan.xpath.XPathSupport | +--net.sf.swan.xpath.Matcher
Utility for XSLT pattern matching of nodes. This can be used to facilitate simple rule-based processing, or for associating arbitrary metadata with nodes based on matching patterns.
Note:The match
operation is a thread-safe
operation; however, other operations on this component such as adding
patterns or adding and changing variables are not thread-safe. This component
should only be used across multiple threads when no further changes are being
made. If one wishes to set variable values for specific matches in a thread-safe
manner, then first create a MatchContext
to use
in that thread. One can then set the variable values on it and pass it as a
parameter to the match
method. Alternatively, one can create a
whole new matcher
.
Fields inherited from class net.sf.swan.xpath.XPathSupport |
defaultParseAdapter, verifyVars |
Constructor Summary | |
Matcher()
|
|
Matcher(Matcher prototype)
|
|
Matcher(org.jaxen.Navigator navigator)
|
|
Matcher(XPathSupport prototype)
|
Method Summary | |
void |
add(Pattern pattern,
java.lang.Object data)
Add a pattern and associated rule or metadata to the Matcher. |
void |
add(Pattern pattern,
java.lang.Object data,
double priority)
Add a pattern and associated rule or metadata to the Matcher. |
void |
add(Pattern filter,
java.lang.String expr,
java.lang.Object data)
|
void |
add(Pattern filter,
java.lang.String expr,
java.lang.Object data,
double priority)
|
void |
add(java.lang.String expr,
java.lang.Object data)
Add a pattern and associated rule or metadata to the Matcher. |
void |
add(java.lang.String expr,
java.lang.Object data,
double priority)
Add a pattern and associated rule or metadata to the Matcher. |
void |
addAll(Matcher matcher)
Merge all of the rules in the specified Matcher into this one. |
MatchContext |
createMatchContext()
Create a MatchContext object that may
be used to iterate through matching rules, and to manipulate
variables for matching in a thread-safe manner. |
void |
loadTemplates(java.lang.Object rootNode,
java.lang.String pattern,
java.lang.String use)
|
void |
loadTemplates(java.lang.Object rootNode,
java.lang.String pattern,
java.lang.String use,
java.lang.String usePriority)
|
java.lang.Object |
match(java.lang.Object node)
Obtain the object associated with the first rule that matches the specified node. |
void |
match(java.lang.Object node,
Match match)
Prepare a Match object that may
be used to iterate through matching rules in order of priority. |
protected Pattern[] |
parsePattern(Pattern filter,
java.lang.String expr)
|
Methods inherited from class net.sf.swan.xpath.XPathSupport |
createContextSupport, createFunctionContext, createMatcher, createNamespaceContext, createSelector, createVariableContext, getContextSupport, getDocument, getFunctionContext, getNavigator, getReader, getVariableValue, getVariableValue, getVariableValue, keyMap, parseAVT, parseAVT, parsePattern, parsePattern, parseXPath, parseXPath, putNamespace, putVariableValue, putVariableValue, resolveNamespacePrefix, setFunctionContext, setNavigator, toBoolean, toList, toSingle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Matcher()
public Matcher(org.jaxen.Navigator navigator)
public Matcher(Matcher prototype)
public Matcher(XPathSupport prototype)
Method Detail |
public void add(java.lang.String expr, java.lang.Object data) throws org.saxpath.SAXPathException
public void add(java.lang.String expr, java.lang.Object data, double priority) throws org.saxpath.SAXPathException
public void add(Pattern filter, java.lang.String expr, java.lang.Object data) throws org.saxpath.SAXPathException
public void add(Pattern filter, java.lang.String expr, java.lang.Object data, double priority) throws org.saxpath.SAXPathException
public void addAll(Matcher matcher)
public void loadTemplates(java.lang.Object rootNode, java.lang.String pattern, java.lang.String use) throws org.saxpath.SAXPathException
public void loadTemplates(java.lang.Object rootNode, java.lang.String pattern, java.lang.String use, java.lang.String usePriority) throws org.saxpath.SAXPathException
public void add(Pattern pattern, java.lang.Object data)
public void add(Pattern pattern, java.lang.Object data, double priority)
public java.lang.Object match(java.lang.Object node) throws org.jaxen.JaxenException
public void match(java.lang.Object node, Match match) throws org.jaxen.JaxenException
Match
object that may
be used to iterate through matching rules in order of priority.public MatchContext createMatchContext()
MatchContext
object that may
be used to iterate through matching rules, and to manipulate
variables for matching in a thread-safe manner.createMatchContext
in class XPathSupport
protected Pattern[] parsePattern(Pattern filter, java.lang.String expr) throws org.saxpath.SAXPathException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |