org.inria.ns.reflex.xml.xpath.pattern
Interface Pattern

All Known Implementing Classes:
JaxenPattern

public interface Pattern

An XPath pattern is a string that is interpreted as a pattern in XSLT.

Variables are supported in predicates.

Author:
Philippe Poulard
See Also:
XFactory.parsePattern(String)

Field Summary
static Pattern MATCH_ALL
          The pattern that maches all nodes : "nodes() | /".
static Pattern MATCH_ALL_NODES
          The pattern that maches all nodes except the root : "nodes()".
 
Method Summary
 double getPriority()
          Returns the default resolution policy of the pattern according to the XSLT conflict resolution spec.
 XFactory getXFactory()
          Return the factory that built this compiled pattern.
 boolean matches(Object node, PatternContext context)
          Test whether a node matches this pattern or not.
 List splitUnionPattern()
          Split this pattern to a list of patterns if it is an union pattern.
 

Field Detail

MATCH_ALL

static final Pattern MATCH_ALL
The pattern that maches all nodes : "nodes() | /".


MATCH_ALL_NODES

static final Pattern MATCH_ALL_NODES
The pattern that maches all nodes except the root : "nodes()".

Method Detail

matches

boolean matches(Object node,
                PatternContext context)
                throws PatternEvaluationException
Test whether a node matches this pattern or not.

Parameters:
node - The node to test.
context - The pattern context.
Returns:
true if the given node matches this pattern, false otherwise.
Throws:
PatternEvaluationException

getPriority

double getPriority()
Returns the default resolution policy of the pattern according to the XSLT conflict resolution spec.


getXFactory

XFactory getXFactory()
Return the factory that built this compiled pattern.

Returns:
The factory that built this compiled pattern.

splitUnionPattern

List splitUnionPattern()
Split this pattern to a list of patterns if it is an union pattern.

Returns:
A list of patterns if this pattern is an union pattern, null otherwise.