Class Evaluator

java.lang.Object
net.sf.saxon.expr.parser.Evaluator

public abstract class Evaluator extends Object
An Evaluator evaluates an expression to return a sequence
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Evaluator
    An evaluator for arguments that in general return a sequence, where the sequence is evaluated eagerly.
    static final Evaluator
    An evaluator that always returns the empty sequence
    static final Evaluator
    An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use.
    static final Evaluator
    An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use.
    static final Evaluator
    An evaluator for arguments supplied as a literal
    static final Evaluator
    An evaluator for an expression that makes use of an indexed variable
    static final Evaluator
    An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use, and where the value might be needed more than once.
    static final Evaluator
    An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use, and where the value might be needed more than once.
    static final Evaluator
    A (default) evaluator for arguments supplied as an expression that will return either a singleton item, or an empty sequence
    static final Evaluator
    A push-mode evaluator for an expression
    static final Evaluator
    An evaluator for "shared append" expressions: used when the argument to a function is a block potentially containing a recursive call.
    static final Evaluator
    A (default) evaluator for arguments supplied as an expression that will always return a singleton item
    static final Evaluator
    An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use, and where the value might be needed more than once.
    static final Evaluator
    An evaluator for the first (streamed) argument of a streamable function call.
    static final Evaluator
    An evaluator for a reference to an external parameter value
    static final Evaluator
    An evaluator for arguments supplied as a variable reference
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Sequence
    Evaluate an expression to return a sequence
    Get an integer code identifying this evaluator (for use in the SEF file).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • EMPTY_SEQUENCE

      public static final Evaluator EMPTY_SEQUENCE
      An evaluator that always returns the empty sequence
    • LITERAL

      public static final Evaluator LITERAL
      An evaluator for arguments supplied as a literal
    • VARIABLE

      public static final Evaluator VARIABLE
      An evaluator for arguments supplied as a variable reference
    • SUPPLIED_PARAMETER

      public static final Evaluator SUPPLIED_PARAMETER
      An evaluator for a reference to an external parameter value
    • SINGLE_ITEM

      public static final Evaluator SINGLE_ITEM
      A (default) evaluator for arguments supplied as an expression that will always return a singleton item
    • OPTIONAL_ITEM

      public static final Evaluator OPTIONAL_ITEM
      A (default) evaluator for arguments supplied as an expression that will return either a singleton item, or an empty sequence
    • LAZY_SEQUENCE

      public static final Evaluator LAZY_SEQUENCE
      An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use. This is appropriate when calling a function which might not use the value, or might not use all of it. It returns a LazySequence, which can only be read once, so this is only suitable for use when calling a function that can be trusted to read the argument once only.
    • MEMO_SEQUENCE

      public static final Evaluator MEMO_SEQUENCE
      An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use, and where the value might be needed more than once.
    • MEMO_CLOSURE

      public static final Evaluator MEMO_CLOSURE
      An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use, and where the value might be needed more than once.
    • SINGLETON_CLOSURE

      public static final Evaluator SINGLETON_CLOSURE
      An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use, and where the value might be needed more than once.
    • EAGER_SEQUENCE

      public static final Evaluator EAGER_SEQUENCE
      An evaluator for arguments that in general return a sequence, where the sequence is evaluated eagerly. This is appropriate when it is known that the function will always use the entire value, or when it will use it more than once.
    • SHARED_APPEND

      public static final Evaluator SHARED_APPEND
      An evaluator for "shared append" expressions: used when the argument to a function is a block potentially containing a recursive call.
    • STREAMING_ARGUMENT

      public static final Evaluator STREAMING_ARGUMENT
      An evaluator for the first (streamed) argument of a streamable function call.
    • MAKE_INDEXED_VARIABLE

      public static final Evaluator MAKE_INDEXED_VARIABLE
      An evaluator for an expression that makes use of an indexed variable
    • PROCESS

      public static final Evaluator PROCESS
      A push-mode evaluator for an expression
    • LAZY_TAIL

      public static final Evaluator LAZY_TAIL
      An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use. This is appropriate when calling a function which might not use the value, or might not use all of it. It returns a LazySequence, which can only be read once, so this is only suitable for use when calling a function that can be trusted to read the argument once only.
  • Constructor Details

    • Evaluator

      public Evaluator()
  • Method Details

    • evaluate

      public abstract Sequence evaluate(Expression expr, XPathContext context) throws XPathException
      Evaluate an expression to return a sequence
      Parameters:
      expr - the expression to be evaluated
      context - the dynamic context for evaluation
      Returns:
      the result of the evaluation
      Throws:
      XPathException - if any dynamic error occurs during the evaluation
    • getEvaluationMode

      public abstract EvaluationMode getEvaluationMode()
      Get an integer code identifying this evaluator (for use in the SEF file). The codes are chosen to be compatible with argument evaluation modes in earlier releases in the interests of SEF compatibility.