com.jclark.xsl.expr
Class AlternativesPattern

java.lang.Object
  extended by com.jclark.xsl.expr.AlternativesPattern
All Implemented Interfaces:
Pattern, TopLevelPattern

 class AlternativesPattern
extends java.lang.Object
implements TopLevelPattern

represents an "OR" (union) of match patterns


Constructor Summary
AlternativesPattern(TopLevelPattern pattern1, PathPattern pattern2)
          construct with a head pattern1 and tail pattern2
 
Method Summary
 PathPattern[] getAlternatives()
          may represent an "or" grouping, so we allow them to be broken out and dealt with separately
 boolean matches(Node node, ExprContext context)
          evaluate to a boolean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlternativesPattern

AlternativesPattern(TopLevelPattern pattern1,
                    PathPattern pattern2)
construct with a head pattern1 and tail pattern2

Method Detail

matches

public boolean matches(Node node,
                       ExprContext context)
                throws XSLException
evaluate to a boolean

Specified by:
matches in interface Pattern
Throws:
XSLException

getAlternatives

public PathPattern[] getAlternatives()
Description copied from interface: TopLevelPattern
may represent an "or" grouping, so we allow them to be broken out and dealt with separately

Specified by:
getAlternatives in interface TopLevelPattern
Returns:
an array of all the alternative PathPatterns