public class LazyExpression extends UnaryExpression
Note that the LazyExpression class does not itself implement any kind of delayed evaluation: calling its evaluateItem() and iterate() methods produces an immediate result. Instead, the existence of a LazyExpression on the expression tree acts as a signal to other classes that evaluation should be delayed, typically by holding the result of the iterate() method in a Closure object.
operandEVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, PUSH_SELECTION, staticProperties, WATCH_METHOD| Constructor and Description |
|---|
LazyExpression(Expression operand)
Create a LazyExpression
|
| Modifier and Type | Method and Description |
|---|---|
Expression |
copy()
Copy an expression.
|
Item |
evaluateItem(XPathContext context)
Evaluate an expression as a single item.
|
java.lang.String |
getExpressionName()
Get a name identifying the kind of expression, in terms meaningful to a user.
|
SequenceIterator |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence.
|
static Expression |
makeLazyExpression(Expression operand)
Create a LazyExpression (factory method)
|
Expression |
optimize(ExpressionVisitor visitor,
ItemType contextItemType)
Perform optimisation of an expression and its subexpressions.
|
void |
process(XPathContext context)
Process the instruction, without returning any tail calls
|
Expression |
typeCheck(ExpressionVisitor visitor,
ItemType contextItemType)
The typeCheck method suppresses compile-time evaluation
|
computeCardinality, computeSpecialProperties, displayOperator, equals, explain, getBaseExpression, getItemType, hashCode, iterateSubExpressions, promote, replaceSubExpression, simplify, toStringaddToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getHostLanguage, getImplementationMethod, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, typeErrorpublic LazyExpression(Expression operand)
operand - the expression to be evaluated lazilypublic static Expression makeLazyExpression(Expression operand)
operand - the expression to be evaluated lazilypublic Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException
typeCheck in class UnaryExpressionvisitor - an expression visitorcontextItemType - the static type of the context itemXPathExceptionpublic Expression optimize(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException
optimize in class UnaryExpressionvisitor - an expression visitorcontextItemType - the static type of "." at the point where this expression is invoked.
The parameter is set to null if it is known statically that the context item will be undefined.
If the type of the context item is not known statically, the argument is set to
Type.ITEM_TYPEXPathException - if an error is discovered during this phase
(typically a type error)public Item evaluateItem(XPathContext context) throws XPathException
evaluateItem in interface EvaluableItemevaluateItem in class Expressioncontext - The context in which the expression is to be evaluatedXPathException - if any dynamic error occurs evaluating the
expressionpublic SequenceIterator iterate(XPathContext context) throws XPathException
iterate in interface SequenceIterableiterate in class Expressioncontext - supplies the context for evaluationXPathException - if any dynamic error occurs evaluating the
expressionpublic void process(XPathContext context) throws XPathException
process in class Expressioncontext - The dynamic context, giving access to the current node,
the current variables, etc.XPathExceptionpublic Expression copy()
copy in class Expressionpublic java.lang.String getExpressionName()
ExpressiongetExpressionName in class Expression