public class StaticFunctionCall extends FunctionCall implements Callable
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD
Constructor and Description |
---|
StaticFunctionCall(Function target,
Expression[] arguments) |
Modifier and Type | Method and Description |
---|---|
Sequence |
call(XPathContext context,
Sequence[] arguments)
Call the Callable.
|
protected int |
computeCardinality()
Compute the static cardinality of this expression
|
Expression |
copy()
Copy an expression.
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
ExpressionCompiler |
getExpressionCompiler()
Return the bytecode compiler for this system function call.
|
StructuredQName |
getFunctionName()
Get the qualified of the function being called
|
ItemType |
getItemType()
Determine the data type of the expression, if possible.
|
Function |
getTargetFunction()
Get the target function to be called
|
Function |
getTargetFunction(XPathContext context)
Get the target function to be called
|
boolean |
isCallOn(Class<? extends SystemFunction> function)
Ask whether this expression is a call on a particular function
|
boolean |
isCallOnSystemFunction(String localName) |
Expression |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Type-check the expression.
|
addExternalFunctionCallToPathMap, adjustRequiredType, checkArgumentCount, checkArguments, checkFunctionCall, equals, evaluateArguments, getArg, getArguments, getArity, getDisplayName, getExpressionName, getImplementationMethod, getNetCost, getOperanda, hashCode, iterate, operands, optimize, pluralArguments, preEvaluate, preEvaluateIfConstant, setArg, setArguments, setOperanda, setOperanda, simplifyArguments, toShortString, toString
addToPathMap, adoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, clearStreamabilityData, computeDependencies, computeSpecialProperties, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getHostLanguage, getIntegerBounds, getIntrinsicDependencies, getLocation, getObjectName, getPackageData, getParentExpression, getPosture, getPostureAndSweepIfKnown, getProperties, getProperty, getRetainedStaticContext, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStreamability, getStreamingAdjunct, getSweep, getSystemId, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isIdentical, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, makeStreamingAdjunct, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, optimizeForType, process, promote, promoteChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setFiltered, setFlattened, setLocation, setParentExpression, setPostureAndSweep, setRetainedStaticContext, setRetainedStaticContextLocally, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toStreamingPattern, typeCheckChildren, typeError, unordered
public StaticFunctionCall(Function target, Expression[] arguments)
public Function getTargetFunction()
public Function getTargetFunction(XPathContext context)
getTargetFunction
in class FunctionCall
context
- the dynamic evaluation context (not used in this implementation)public StructuredQName getFunctionName()
getFunctionName
in class FunctionCall
public boolean isCallOn(Class<? extends SystemFunction> function)
isCallOn
in class Expression
function
- the implementation class of the function in questionpublic boolean isCallOnSystemFunction(String localName)
isCallOnSystemFunction
in class Expression
public Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
typeCheck
in class FunctionCall
visitor
- the expression visitorcontextInfo
- information about the type of the context itemXPathException
- if an error is discovered during this phase
(typically a type error)public Expression copy()
copy
in class Expression
protected int computeCardinality()
computeCardinality
in class Expression
StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
public ItemType getItemType()
This method should always return a result, though it may be the best approximation that is available at the time.
getItemType
in class Expression
public Sequence call(XPathContext context, Sequence[] arguments) throws XPathException
call
in interface Callable
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 GroundedValue
by 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
Item
or AtomicValue
.
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.
XPathException
- if a dynamic error occurs during the evaluation of the expressionpublic void export(ExpressionPresenter out)
export
in class FunctionCall
out
- public ExpressionCompiler getExpressionCompiler() throws CannotCompileException
getExpressionCompiler
in class Expression
CannotCompileException
- if it is not possible to generate bytecode for this expressionCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.