Class StaticFunctionCall
- All Implemented Interfaces:
Callable,ExportAgent,Locatable,IdentityComparable,Traceable
- Direct Known Subclasses:
SystemFunctionCall
-
Nested Class Summary
Nested classes/interfaces inherited from class net.sf.saxon.expr.FunctionCall
FunctionCall.FunctionCallElaborator -
Field Summary
Fields inherited from class net.sf.saxon.expr.Expression
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall(XPathContext context, Sequence[] arguments) Call the Callable.protected intCompute the static cardinality of this expressioncopy(RebindingMap rebindings) Copy an expression.voidSerialized output of expression structure.Make an elaborator for this expressionGet a name identifying the kind of expression, in terms meaningful to a user.Get the qualified of the function being calledDetermine the data type of the expression, if possible.getStaticUType(UType contextItemType) Get the static type of the expression as a UType, following precisely the type inference rules defined in the XSLT 3.0 specification.Get the target function to be calledgetTargetFunction(XPathContext context) Get the target function to be calledbooleanisCallOn(Class<? extends SystemFunction> function) Ask whether this expression is a call on a particular functiontypeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) Type-check the expression.Methods inherited from class net.sf.saxon.expr.FunctionCall
addExternalFunctionCallToPathMap, adjustRequiredType, checkArgumentCount, checkArguments, checkFunctionCall, computeHashCode, equals, evaluateItem, getArg, getArguments, getArity, getDisplayName, getImplementationMethod, getNetCost, getOperanda, iterate, operands, optimize, plural, preEvaluate, preEvaluateIfConstant, setArg, setArguments, setOperanda, setOperanda, simplifyArguments, toShortString, toStringMethods inherited from class net.sf.saxon.expr.Expression
addToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeSpecialProperties, computeStaticProperties, dispatchTailCall, dynamicError, effectiveBooleanValue, evaluateAsString, explain, getCardinality, getConfiguration, getCost, getDependencies, getEvaluationMethod, getExtraProperty, getIntegerBounds, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStreamerName, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isEqual, isIdentical, isInstruction, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, makeElaborator, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, prepareForStreaming, process, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, supportsLazyEvaluation, suppressValidation, toPattern, typeCheckChildren, typeError, unordered, verifyParentPointers, withLocationMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.trace.Traceable
gatherProperties
-
Constructor Details
-
StaticFunctionCall
-
-
Method Details
-
getTargetFunction
Get the target function to be called- Returns:
- the target function
-
getTargetFunction
Get the target function to be called- Specified by:
getTargetFunctionin classFunctionCall- Parameters:
context- the dynamic evaluation context (not used in this implementation)- Returns:
- the target function
-
getFunctionName
Get the qualified of the function being called- Specified by:
getFunctionNamein classFunctionCall- Returns:
- the qualified name
-
isCallOn
Ask whether this expression is a call on a particular function- Overrides:
isCallOnin classExpression- Parameters:
function- the implementation class of the function in question- Returns:
- true if the expression is a call on the function
-
typeCheck
public Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException Type-check the expression. This also calls preEvaluate() to evaluate the function if all the arguments are constant; functions that do not require this behavior can override the preEvaluate method.- Overrides:
typeCheckin classFunctionCall- Parameters:
visitor- the expression visitorcontextInfo- information about the type of the context item- Returns:
- the original expression, rewritten to perform necessary run-time type checks, and to perform other type-related optimizations
- Throws:
XPathException- if an error is discovered during this phase (typically a type error)
-
copy
Copy an expression. This makes a deep copy.- Specified by:
copyin classExpression- Parameters:
rebindings- variables that need to be re-bound- Returns:
- the copy of the original expression
-
computeCardinality
protected int computeCardinality()Compute the static cardinality of this expression- Specified by:
computeCardinalityin classExpression- Returns:
- the computed cardinality, as one of the values
StaticProperty.ALLOWS_ZERO_OR_ONE,StaticProperty.EXACTLY_ONE,StaticProperty.ALLOWS_ONE_OR_MORE,StaticProperty.ALLOWS_ZERO_OR_MORE
-
getItemType
Determine the data type of the expression, if possible. All expression return sequences, in general; this method determines the type of the items within the sequence, assuming that (a) this is known in advance, and (b) it is the same for all items in the sequence.This method should always return a result, though it may be the best approximation that is available at the time.
- Specified by:
getItemTypein classExpression- Returns:
- a value such as Type.STRING, Type.BOOLEAN, Type.NUMBER, Type.NODE, or Type.ITEM (meaning not known at compile time)
-
getStaticUType
Get the static type of the expression as a UType, following precisely the type inference rules defined in the XSLT 3.0 specification.- Overrides:
getStaticUTypein classExpression- Parameters:
contextItemType- the static type of the context item- Returns:
- the static item type of the expression according to the XSLT 3.0 defined rules
-
call
Call the Callable.- Specified by:
callin interfaceCallable- Parameters:
context- the dynamic evaluation contextarguments- the values of the arguments, supplied as Sequences.Generally it is advisable, if calling iterate() to process a supplied sequence, to call it only once; if the value is required more than once, it should first be converted to a
GroundedValueby calling the utility methd SequenceTool.toGroundedValue().If the expected value is a single item, the item should be obtained by calling Sequence.head(): it cannot be assumed that the item will be passed as an instance of
ItemorAtomicValue.It is the caller's responsibility to perform any type conversions required to convert arguments to the type expected by the callee. An exception is where this Callable is explicitly an argument-converting wrapper around the original Callable.
- Returns:
- the result of the evaluation, in the form of a Sequence. It is the responsibility of the callee to ensure that the type of result conforms to the expected result type.
- Throws:
XPathException- if a dynamic error occurs during the evaluation of the expression
-
getExpressionName
Get a name identifying the kind of expression, in terms meaningful to a user.- Overrides:
getExpressionNamein classFunctionCall- Returns:
- a name identifying the kind of expression, in terms meaningful to a user. The name will always be in the form of a lexical XML QName, and should match the name used in explain() output displaying the expression.
-
export
Serialized output of expression structure. The abstract expression tree is written to the supplied output destination.- Specified by:
exportin interfaceExportAgent- Overrides:
exportin classFunctionCall- Parameters:
out- destination of the SEF output- Throws:
XPathException- if the export fails, for example if an expression is found that won't work in the target environment.
-
getElaborator
Description copied from class:ExpressionMake an elaborator for this expression- Overrides:
getElaboratorin classExpression- Returns:
- an appropriate
Elaborator
-