Package net.sf.saxon.expr.parser
Class Evaluator
java.lang.Object
net.sf.saxon.expr.parser.Evaluator
An Evaluator evaluates an expression to return a sequence
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 sequencestatic 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 literalstatic final Evaluator
An evaluator for an expression that makes use of an indexed variablestatic 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 sequencestatic final Evaluator
A push-mode evaluator for an expressionstatic 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 itemstatic 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 valuestatic final Evaluator
An evaluator for arguments supplied as a variable reference -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Sequence
evaluate
(Expression expr, XPathContext context) Evaluate an expression to return a sequenceabstract EvaluationMode
Get an integer code identifying this evaluator (for use in the SEF file).
-
Field Details
-
EMPTY_SEQUENCE
An evaluator that always returns the empty sequence -
LITERAL
An evaluator for arguments supplied as a literal -
VARIABLE
An evaluator for arguments supplied as a variable reference -
SUPPLIED_PARAMETER
An evaluator for a reference to an external parameter value -
SINGLE_ITEM
A (default) evaluator for arguments supplied as an expression that will always return a singleton item -
OPTIONAL_ITEM
A (default) evaluator for arguments supplied as an expression that will return either a singleton item, or an empty sequence -
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 aLazySequence
, 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
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
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
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
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
An evaluator for "shared append" expressions: used when the argument to a function is a block potentially containing a recursive call. -
STREAMING_ARGUMENT
An evaluator for the first (streamed) argument of a streamable function call. -
MAKE_INDEXED_VARIABLE
An evaluator for an expression that makes use of an indexed variable -
PROCESS
A push-mode evaluator for an expression -
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 aLazySequence
, 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
Evaluate an expression to return a sequence- Parameters:
expr
- the expression to be evaluatedcontext
- the dynamic context for evaluation- Returns:
- the result of the evaluation
- Throws:
XPathException
- if any dynamic error occurs during the evaluation
-
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.
-