net.sf.saxon.functions

Class Evaluate

Implemented Interfaces:
EvaluableItem, InstructionInfoProvider, SequenceIterable, Serializable, SourceLocator

public class Evaluate
extends SystemFunction

This class implements the saxon:evaluate(), saxon:expression(), and saxon:eval() extension functions, which are specially-recognized by the system because they need access to parts of the static context

Nested Class Summary

static class
Evaluate.PreparedExpression
Inner class PreparedExpression represents a compiled XPath expression together with the standard variables $p1 ..

Field Summary

static int
EVAL
static int
EVALUATE
static int
EVALUATE_NODE
static int
EXPRESSION

Fields inherited from class net.sf.saxon.functions.SystemFunction

operation

Fields inherited from class net.sf.saxon.expr.FunctionCall

argument

Fields inherited from class net.sf.saxon.expr.Expression

EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD, locationId, staticProperties

Method Summary

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.

Methods inherited from class net.sf.saxon.functions.SystemFunction

addContextDocumentArgument, addDocToPathMap, checkArguments, computeCardinality, computeSpecialProperties, copy, getDetails, getErrorCodeForTypeErrors, getItemType, getRequiredType, makeSystemFunction, optimize, setDetails, useContextItemAsDefault

Methods inherited from class net.sf.saxon.expr.FunctionCall

addExternalFunctionCallToPathMap, checkArgumentCount, checkArguments, equals, explain, getArguments, getDisplayName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, optimize, preEvaluate, promote, replaceSubExpression, setArguments, setFunctionName, simplify, simplifyArguments, toString, typeCheck

Methods inherited from class net.sf.saxon.expr.Expression

addToPathMap, adoptChildExpression, checkPermittedContents, computeCardinality, computeDependencies, computeSpecialProperties, computeStaticProperties, copy, display, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, explain, explain, findParentOf, getCardinality, getColumnNumber, getConstructType, getContainer, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getItemType, getLineNumber, getLocationId, getLocationProvider, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, iterate, iterateEvents, iterateSubExpressions, markTailFunctionCalls, optimize, process, promote, replaceSubExpression, resetLocalStaticProperties, setContainer, setFiltered, setFlattened, setLocationId, simplify, staticTypeCheck, suppressValidation, toString, typeCheck, typeError

Field Details

EVAL

public static final int EVAL
Field Value:
2

EVALUATE

public static final int EVALUATE
Field Value:
0

EVALUATE_NODE

public static final int EVALUATE_NODE
Field Value:
3

EXPRESSION

public static final int EXPRESSION
Field Value:
1

Method Details

checkArguments

public void checkArguments(ExpressionVisitor visitor)
            throws XPathException
Method supplied by each class of function to check arguments during parsing, when all the argument expressions have been read
Overrides:
checkArguments in interface SystemFunction

evaluateItem

public Item evaluateItem(XPathContext c)
            throws XPathException
Evaluate in a general context
Specified by:
evaluateItem in interface EvaluableItem
Overrides:
evaluateItem in interface Expression

getIntrinsicDependencies

public int getIntrinsicDependencies()
Determine the dependencies
Overrides:
getIntrinsicDependencies in interface Expression

getRequiredType

protected SequenceType getRequiredType(int arg)
Get the required type of the nth argument
Overrides:
getRequiredType in interface SystemFunction

iterate

public SequenceIterator iterate(XPathContext c)
            throws XPathException
Iterate over the results of the function
Specified by:
iterate in interface SequenceIterable
Overrides:
iterate in interface Expression

preEvaluate

public Expression preEvaluate(ExpressionVisitor visitor)
            throws XPathException
preEvaluate: for saxon:expression, if the expression is known at compile time, then it is compiled at compile time. In other cases this method suppresses compile-time evaluation by doing nothing (because the value of the expression depends on the runtime context).
Overrides:
preEvaluate in interface FunctionCall
Parameters:
visitor - an expression visitor