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(RebindingMap rebindings)
Copy an expression.
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
java.lang.String |
getExpressionName()
Get a name identifying the kind of expression, in terms meaningful to a user.
|
StructuredQName |
getFunctionName()
Get the qualified of the function being called
|
ItemType |
getItemType()
Determine the data type of the expression, if possible.
|
UType |
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.
|
Function |
getTargetFunction()
Get the target function to be called
|
Function |
getTargetFunction(XPathContext context)
Get the target function to be called
|
boolean |
isCallOn(java.lang.Class<? extends SystemFunction> function)
Ask whether this expression is a call on a particular function
|
boolean |
isCallOnSystemFunction(java.lang.String localName)
Ask whether this expression is a call on a particular function
|
Expression |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Type-check the expression.
|
addExternalFunctionCallToPathMap, adjustRequiredType, checkArgumentCount, checkArguments, checkFunctionCall, computeHashCode, equals, evaluateArguments, getArg, getArguments, getArity, getDisplayName, getImplementationMethod, getNetCost, getOperanda, iterate, operands, optimize, pluralArguments, preEvaluate, preEvaluateIfConstant, setArg, setArguments, setOperanda, setOperanda, simplifyArguments, toShortString, toString
addToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeSpecialProperties, computeStaticProperties, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getExtraProperty, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStreamerName, hasCompatibleStaticContext, hashCode, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isIdentical, isInstruction, isLiftable, isMultiThreaded, isSameExpression, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, process, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, typeCheckChildren, typeError, unordered, verifyParentPointers, verifyParentPointers
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(java.lang.Class<? extends SystemFunction> function)
isCallOn
in class Expression
function
- the implementation class of the function in questionpublic boolean isCallOnSystemFunction(java.lang.String localName)
Expression
isCallOnSystemFunction
in class Expression
localName
- the name of the function in question, in the standard fn namespacepublic 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(RebindingMap rebindings)
copy
in class Expression
rebindings
- 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 UType getStaticUType(UType contextItemType)
getStaticUType
in class Expression
contextItemType
- the static type of the context itempublic 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 java.lang.String getExpressionName()
getExpressionName
in class FunctionCall
public void export(ExpressionPresenter out) throws XPathException
export
in interface ExportAgent
export
in class FunctionCall
out
- XPathException
- if the export fails, for example if an expression is found that won't work
in the target environment.Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.