Interface XPathExpression

All Known Subinterfaces:
BinaryExpr, EqualityExpr, FilterExpr, GroupedExpression, LocationStep, NodeExpression, PathComponent
All Known Implementing Classes:
AbstractPathComponent, BooleanFunctionCall, Concat, Contains, CountFunctionCall, ErrorExpr, ErrorFunctionCall, ExtensionFunctionCall, FalseFunctionCall, FormatNumber, FunctionCall, FunctionCallImpl, IdFunctionCall, IdRefFunctionCall, LangFunctionCall, LastFunctionCall, Normalize, NotFunctionCall, NumberFunctionCall, PathExpr, PositionFunctionCall, PredicateExpr, PrimaryExpr, SelectExpr, StartsWith, StringFunctionCall, StringLength, Substring, SubstringAfter, SubstringBefore, SumFunctionCall, TextFunctionCall, Translate, TrueFunctionCall, UnionExpr, VariableReference, XMLNamesFunctionCall

public interface XPathExpression
Interface representing an XPath expression. An XPath expression is thread-safe and can be evaluated multiple times concurrently. It is a compiled version of the textual XPath expression and can be cached for later use.
Version:
$Revision: 3738 $
Author:
Keith Visco, Assaf Arkin
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final short
    The Boolean expression type.
    static final short
    Expression of type error.
    static final short
    The FilterExpr expression type.
    static final short
    The LocationPath expression type.
    static final short
    The NodeTest expressions type
    static final short
    The NodeTest expressions type
    static final short
    The PathExpr expression type.
    static final short
    The Primary expression type.
    static final short
    The Step expression type.
    static final short
    The String expression type.
    static final short
    The union expression type.
  • Method Summary

    Modifier and Type
    Method
    Description
    Evaluates the expression and returns the XPath result.
    short
    Returns the type of this expression.
    Returns the XPath expression as a string.
  • Field Details

  • Method Details

    • getExprType

      short getExprType()
      Returns the type of this expression.
      Returns:
      The type of this expression
    • evaluate

      XPathResult evaluate(XPathContext context) throws XPathException
      Evaluates the expression and returns the XPath result.
      Parameters:
      context - The XPathContext to use during evaluation.
      Returns:
      The XPathResult (not null).
      Throws:
      XPathException - if an error occured while evaluating this expression.
    • toString

      String toString()
      Returns the XPath expression as a string. The returned value is a valid XPath expression that can be parsed into an equivalent XPathExpression object.
      Overrides:
      toString in class Object
      Returns:
      The XPath expression as a string