org.exolab.adaptx.xpath.expressions

Class UnionExpr

public abstract class UnionExpr extends 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

Method Summary
shortgetExprType()
Returns the type of Expr this Expr represents
PathExprgetMatchingExpr(XPathNode node, XPathContext context)
Retrieves the PathExpr that matches the given node.
abstract PathExprgetPathExpr()
Returns the PathExpr of this UnionExpr.
abstract UnionExprgetUnionExpr()
Returns the UnionExpr that this UnionExpr is in union with.
abstract booleanmatches(XPathNode node, XPathContext context)
Determines if the given node is matched by this MatchExpr with respect to the given context.

Method Detail

getExprType

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

Returns: the type of Expr this Expr represents

getMatchingExpr

public PathExpr getMatchingExpr(XPathNode node, XPathContext context)
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

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: UnionExpr

matches

public abstract boolean matches(XPathNode node, XPathContext context)
Determines if the given node is matched by this MatchExpr 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 MatchExpr

Throws: XPathException when an error occurs during evaluation