net.sf.saxon.functions
public class Evaluate extends SystemFunction
Modifier and Type | Class and Description |
---|---|
static class |
Evaluate.PreparedExpression
Inner class PreparedExpression represents a compiled XPath expression together
with the standard variables $p1 ..
|
Modifier and Type | Field and Description |
---|---|
static int |
EVAL |
static int |
EVALUATE |
static int |
EVALUATE_NODE |
static int |
EXPRESSION |
operation
argument
EVALUATE_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, staticProperties
Constructor and Description |
---|
Evaluate() |
Modifier and Type | Method and Description |
---|---|
PathMap.PathMapNodeSet |
addToPathMap(PathMap pathMap,
PathMap.PathMapNodeSet pathMapNodeSet)
Add a representation of this expression to a PathMap.
|
void |
checkArguments(ExpressionVisitor visitor)
Method supplied by each class of function to check arguments during parsing, when all
the argument expressions have been read
|
Item |
evaluateItem(XPathContext c)
Evaluate in a general context
|
int |
getIntrinsicDependencies()
Determine the dependencies
|
protected SequenceType |
getRequiredType(int arg)
Get the required type of the nth argument
|
SequenceIterator |
iterate(XPathContext c)
Iterate over the results of the function
|
Expression |
preEvaluate(ExpressionVisitor visitor)
preEvaluate: for saxon:expression, if the expression is
known at compile time, then it is compiled at compile time.
|
addContextDocumentArgument, addDocToPathMap, computeCardinality, computeSpecialProperties, copy, getDetails, getErrorCodeForTypeErrors, getItemType, makeSystemFunction, optimize, setDetails, useContextItemAsDefault
addExternalFunctionCallToPathMap, checkArgumentCount, equals, explain, getArguments, getDisplayName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, promote, replaceSubExpression, setArguments, setFunctionName, simplify, simplifyArguments, toString, typeCheck
adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, display, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluatePendingUpdates, explain, findParentOf, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, isUpdatingExpression, iterateEvents, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, typeError
public static final int EVALUATE
public static final int EXPRESSION
public static final int EVAL
public static final int EVALUATE_NODE
protected SequenceType getRequiredType(int arg)
getRequiredType
in class SystemFunction
arg
- the number of the argument whose type is requested, zero-basedpublic void checkArguments(ExpressionVisitor visitor) throws XPathException
checkArguments
in class SystemFunction
visitor
- the expression visitorXPathException
public Expression preEvaluate(ExpressionVisitor visitor) throws XPathException
preEvaluate
in class FunctionCall
visitor
- an expression visitorXPathException
public PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
The default implementation of this method assumes that an expression does no navigation other than the navigation done by evaluating its subexpressions, and that the subexpressions are evaluated in the same context as the containing expression. The method must be overridden for any expression where these assumptions do not hold. For example, implementations exist for AxisExpression, ParentExpression, and RootExpression (because they perform navigation), and for the doc(), document(), and collection() functions because they create a new navigation root. Implementations also exist for PathExpression and FilterExpression because they have subexpressions that are evaluated in a different context from the calling expression.
This particular implementation has to deal with the fact that saxon:evaluate() and related functions can navigate anywhere in the tree.
addToPathMap
in class Expression
pathMap
- the PathMap to which the expression should be addedpathMapNodeSet
- the PathMapNodeSet to which the paths embodied in this expression should be addedpublic Item evaluateItem(XPathContext c) throws XPathException
evaluateItem
in interface EvaluableItem
evaluateItem
in class Expression
c
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionpublic SequenceIterator iterate(XPathContext c) throws XPathException
iterate
in interface SequenceIterable
iterate
in class Expression
c
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionpublic int getIntrinsicDependencies()
getIntrinsicDependencies
in class Expression