org.exolab.adaptx.xpath.expressions
Class UnionExpr

java.lang.Object
  extended by org.exolab.adaptx.xpath.expressions.UnionExpr
All Implemented Interfaces:
MatchExpression, XPathExpression

public abstract class UnionExpr
extends java.lang.Object
implements XPathExpression, MatchExpression

An abstract class that represents an XPath Union expression

 UnionExpr ::= PathExpr | (PathExpr '|' UnionExpr)
 

Version:
$Revision: 3734 $ $Date: 2003-05-13 03:55:04 -0400 (Tue, 13 May 2003) $
Author:
Keith Visco

Field Summary
 
Fields inherited from interface org.exolab.adaptx.xpath.XPathExpression
BOOLEAN, ERROR, FILTER_EXPR, LOCATION_PATH, NODE_TEST, NUMBER, PATH_EXPR, PRIMARY, STEP, STRING, UNION_EXPR
 
Constructor Summary
UnionExpr()
           
 
Method Summary
 short getExprType()
          Returns the type of Expr this Expr represents
 PathExpr getMatchingExpr(XPathNode node, XPathContext context)
          Retrieves the PathExpr that matches the given node.
abstract  PathExpr getPathExpr()
          Returns the PathExpr of this UnionExpr.
abstract  UnionExpr getUnionExpr()
          Returns the UnionExpr that this UnionExpr is in union with.
abstract  boolean matches(XPathNode node, XPathContext context)
          Determines if the given node is matched by this MatchExpr with respect to the given context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.exolab.adaptx.xpath.XPathExpression
evaluate, toString
 

Constructor Detail

UnionExpr

public UnionExpr()
Method Detail

getPathExpr

public abstract PathExpr getPathExpr()
Returns the PathExpr of this UnionExpr. A UnionExpr is defined by XPath 1.0 as:
 UnionExpr ::= PathExpr | (PathExpr '|' UnionExpr)
 

Returns:
the PathExpr of this UnionExpr.

getUnionExpr

public abstract UnionExpr getUnionExpr()
Returns the UnionExpr that this UnionExpr is in union with. A UnionExpr is defined by XPath 1.0 as:
 UnionExpr ::= PathExpr | (PathExpr '|' UnionExpr)
 

Returns:
the UnionExpr that this UnionExpr is in union with, or null if this is UnionExpr only contains a PathExpr.
See Also:
getPathExpr()

getExprType

public final short getExprType()
Returns the type of Expr this Expr represents

Specified by:
getExprType in interface XPathExpression
Returns:
the type of Expr this Expr represents

getMatchingExpr

public PathExpr getMatchingExpr(XPathNode node,
                                XPathContext context)
                         throws XPathException
Retrieves the PathExpr that matches the given node. If more than one PathExpr matches the given node, the most specific PathExpr will be returned.

Parameters:
node - the node to test for matching
Returns:
the matching PathExpr or null if none match
Throws:
XPathException

matches

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

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