Package net.sf.saxon.expr.elab
Class FallbackElaborator
- java.lang.Object
-
- net.sf.saxon.expr.elab.Elaborator
-
- net.sf.saxon.expr.elab.FallbackElaborator
-
- Direct Known Subclasses:
ComplexNodePushElaborator
public class FallbackElaborator extends Elaborator
The FallbackElaborator performs elaboration of expressions for which no more specific elaborator is available. It produces evaluation functions that simply call the direct evaluation interfaces. Note that when a FallbackElaborator is used, the entire contained subtree will be interpreted in the traditional way, with no benefit from elaboration.
-
-
Constructor Summary
Constructors Constructor Description FallbackElaborator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SequenceEvaluator
eagerly()
Get a function that evaluates the underlying expression eagerlyBooleanEvaluator
elaborateForBoolean()
Get a function that evaluates the underlying expression in the form of a boolean, this being the effective boolean value of the expression.ItemEvaluator
elaborateForItem()
Get a function that evaluates the underlying expression in the form of aItem
.PullEvaluator
elaborateForPull()
Get a function that evaluates the underlying expression in the form of aSequenceIterator
PushEvaluator
elaborateForPush()
Get a function that evaluates the underlying expression in push mode, by writing events to anOutputter
UnicodeStringEvaluator
elaborateForUnicodeString(boolean zeroLengthWhenAbsent)
Get a function that evaluates the underlying expression in the form of a unicode string, this being the result of applying fn:string() to the result of the expression.SequenceEvaluator
lazily(boolean repeatable, boolean lazyEvaluationRequired)
Get a function that evaluates the underlying expression lazily-
Methods inherited from class net.sf.saxon.expr.elab.Elaborator
elaborateForString, elaborateForUpdate, getConfiguration, getExpression, handleNullString, handleNullUnicodeString, handlePossiblyNullString, handlePossiblyNullUnicodeString, setExpression
-
-
-
-
Method Detail
-
eagerly
public SequenceEvaluator eagerly()
Description copied from class:Elaborator
Get a function that evaluates the underlying expression eagerly- Overrides:
eagerly
in classElaborator
- Returns:
- an evaluator for the expression that returns a
GroundedValue
. The classSequenceEvaluator
is declared to return aSequence
not aGroundedValue
; we can't specialize it because it's a limitation of C# delegates, but the result can safely be cast toGroundedValue
.
-
lazily
public SequenceEvaluator lazily(boolean repeatable, boolean lazyEvaluationRequired)
Description copied from class:Elaborator
Get a function that evaluates the underlying expression lazily- Overrides:
lazily
in classElaborator
- Parameters:
repeatable
- true if the resultingSequence
must be usable repeatedly; false if it only needs to be used oncelazyEvaluationRequired
- true if the expression MUST be evaluated lazily, for example to prevent spurious errors or side-effects if it has been lifted out of a loop- Returns:
- an evaluator for the expression that returns a
Sequence
(which may be a lazy sequence)
-
elaborateForPull
public PullEvaluator elaborateForPull()
Description copied from class:Elaborator
Get a function that evaluates the underlying expression in the form of aSequenceIterator
- Specified by:
elaborateForPull
in classElaborator
- Returns:
- an evaluator for the expression that returns a
SequenceIterator
-
elaborateForPush
public PushEvaluator elaborateForPush()
Description copied from class:Elaborator
Get a function that evaluates the underlying expression in push mode, by writing events to anOutputter
- Specified by:
elaborateForPush
in classElaborator
- Returns:
- an evaluator for the expression in push mode
-
elaborateForItem
public ItemEvaluator elaborateForItem()
Description copied from class:Elaborator
Get a function that evaluates the underlying expression in the form of aItem
. This must only be called for expressions whose result has cardinality zero or one.- Specified by:
elaborateForItem
in classElaborator
- Returns:
- an evaluator for the expression that returns an
Item
, or null to represent an empty sequence.
-
elaborateForBoolean
public BooleanEvaluator elaborateForBoolean()
Description copied from class:Elaborator
Get a function that evaluates the underlying expression in the form of a boolean, this being the effective boolean value of the expression.- Specified by:
elaborateForBoolean
in classElaborator
- Returns:
- an evaluator for the expression that returns a boolean.
-
elaborateForUnicodeString
public UnicodeStringEvaluator elaborateForUnicodeString(boolean zeroLengthWhenAbsent)
Description copied from class:Elaborator
Get a function that evaluates the underlying expression in the form of a unicode string, this being the result of applying fn:string() to the result of the expression.- Specified by:
elaborateForUnicodeString
in classElaborator
- Parameters:
zeroLengthWhenAbsent
- if true, then when the result of the expression is an empty sequence, the result of the StringEvaluator should be a zero-length string. If false, the return value should be null. For an expression or function that never returns an empty sequence (for example, a call on string() or normalize-space()), the argument has no effect.- Returns:
- an evaluator for the expression that returns a string.
-
-