|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.expr.Expression
net.sf.saxon.expr.FunctionCall
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.Evaluate
public class Evaluate
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, locationId, PROCESS_METHOD, staticProperties |
Constructor Summary | |
---|---|
Evaluate()
|
Method Summary | |
---|---|
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. |
Methods inherited from class net.sf.saxon.functions.SystemFunction |
---|
addContextDocumentArgument, addDocToPathMap, computeCardinality, computeSpecialProperties, copy, getDetails, getErrorCodeForTypeErrors, getItemType, makeSystemFunction, optimize, setDetails, useContextItemAsDefault |
Methods inherited from class net.sf.saxon.expr.FunctionCall |
---|
addExternalFunctionCallToPathMap, checkArgumentCount, equals, explain, getArguments, getDisplayName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, promote, replaceSubExpression, setArguments, setFunctionName, simplify, simplifyArguments, toString, typeCheck |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int EVALUATE
public static final int EXPRESSION
public static final int EVAL
public static final int EVALUATE_NODE
Constructor Detail |
---|
public Evaluate()
Method Detail |
---|
protected SequenceType getRequiredType(int arg)
getRequiredType
in class SystemFunction
arg
- the number of the argument whose type is requested, zero-based
public void checkArguments(ExpressionVisitor visitor) throws XPathException
checkArguments
in class SystemFunction
visitor
- the expression visitor
XPathException
public Expression preEvaluate(ExpressionVisitor visitor) throws XPathException
preEvaluate
in class FunctionCall
visitor
- an expression visitor
XPathException
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 added
public Item evaluateItem(XPathContext c) throws XPathException
evaluateItem
in interface EvaluableItem
evaluateItem
in class Expression
c
- The context in which the expression is to be evaluated
XPathException
- 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 evaluation
XPathException
- if any dynamic error occurs evaluating the
expressionpublic int getIntrinsicDependencies()
getIntrinsicDependencies
in class Expression
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |