Class 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 09:55:04 +0200 (Tue, 13 May 2003) $
    Author:
    Keith Visco
    • 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