org.exolab.adaptx.xslt
Class Pattern

java.lang.Object
  extended by org.exolab.adaptx.xslt.Pattern

public class Pattern
extends java.lang.Object

This class represents a "pattern" as specified in the W3C XSLT 1.0 Recommendation.

Version:
$Revision: 3740 $ $Date: 2003-05-13 04:01:53 -0400 (Tue, 13 May 2003) $
Author:
Keith Visco

Constructor Summary
Pattern()
          Creates a new default pattern.
Pattern(java.lang.String pattern)
           
 
Method Summary
 LocationPathPattern getMatchingPattern(XPathNode node, XPathContext context)
          Returns the LocationPathPattern with the highest priority that matches the given XPathNode using the given XPathContext.
 boolean matches(XPathNode node, XPathContext context)
          Determines if the given node is matched by this Pattern with respect to the given context.
 java.lang.String toString()
          Returns the String representation of this Pattern.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pattern

public Pattern()
Creates a new default pattern. This pattern has zero location paths and will match no nodes.


Pattern

public Pattern(java.lang.String pattern)
        throws PatternException
Throws:
PatternException
Method Detail

getMatchingPattern

public LocationPathPattern getMatchingPattern(XPathNode node,
                                              XPathContext context)
                                       throws XPathException
Returns the LocationPathPattern with the highest priority that matches the given XPathNode using the given XPathContext.

Parameters:
node - the node to determine a match for
context - the XPathContext
Returns:
the LocationPathPattern with the highest priority that matches the given XPathNode using the given XPathContext. Null will be returned if no matching LocationPathPattern objects are contained in this Pattern.
Throws:
XPathException

matches

public boolean matches(XPathNode node,
                       XPathContext context)
                throws XPathException
Determines if the given node is matched by this Pattern with respect to the given context.

Parameters:
node - the node to determine a match for
context - the XPathContext
Returns:
true if the given node is matched by this Pattern
Throws:
XPathException - when an error occurs during evaluation

toString

public java.lang.String toString()
Returns the String representation of this Pattern. This will be an equivalent string to that which this pattern was created from, or the empty string if this pattern is the default pattern.

Overrides:
toString in class java.lang.Object
Returns:
the String representation of this Pattern.