Package net.sf.saxon.functions
Class ApplyFn
java.lang.Object
net.sf.saxon.functions.AbstractFunction
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.ApplyFn
- All Implemented Interfaces:
Callable
,FunctionItem
,GroundedValue
,Item
,Sequence
This class implements the function fn:apply(), which is a standard function in XQuery 3.1.
The fn:apply function is also used internally to implement dynamic function calls.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall
(XPathContext context, Sequence[] arguments) Evaluate the expressionvoid
Export any context attributes held within the SystemFunction object.getResultItemType
(Expression[] args) Get the return type, given knowledge of the actual argumentsvoid
importAttributes
(Properties attributes) Import any attributes found in the export file, that is, any attributes output using the exportAttributes methodmakeOptimizedFunctionCall
(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo, Expression... arguments) Allow the function to create an optimized call based on the values of the actual argumentsMethods inherited from class net.sf.saxon.functions.SystemFunction
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, fixArguments, getArity, getCardinality, getContextNode, getDescription, getDetails, getElaborator, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, getUniStringArg, hashCode, isSequenceVariadic, isTrustedResultType, makeCall, makeFunction, makeFunction40, makeFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCaller
Methods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEqual40, deepEquals, effectiveBooleanValue, getAnnotations, getUnicodeStringValue, isArray, isMap, makeNewContext, simplify, typeCheck
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.saxon.om.FunctionItem
getGenre
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
Methods inherited from interface net.sf.saxon.om.Item
getLength, getStringValue, head, isStreamed, itemAt, iterate, reduce, subsequence
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
ApplyFn
public ApplyFn()
-
-
Method Details
-
getResultItemType
Get the return type, given knowledge of the actual arguments- Overrides:
getResultItemType
in classSystemFunction
- Parameters:
args
- the actual arguments supplied- Returns:
- the best available item type that the function will return
-
makeOptimizedFunctionCall
public Expression makeOptimizedFunctionCall(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo, Expression... arguments) throws XPathException Description copied from class:SystemFunction
Allow the function to create an optimized call based on the values of the actual arguments- Overrides:
makeOptimizedFunctionCall
in classSystemFunction
- Parameters:
visitor
- the expression visitorcontextInfo
- information about the context itemarguments
- the supplied arguments to the function call. Note: modifying the contents of this array should not be attempted, it is likely to have no effect.- Returns:
- either a function call on this function, or an expression that delivers the same result, or null indicating that no optimization has taken place
- Throws:
XPathException
- if an error is detected
-
call
Evaluate the expression- Parameters:
context
- the dynamic evaluation contextarguments
- the values of the arguments. The first argument is the function item to be called; the second argument is an array containing the arguments to be passed to that function, before conversion.- Returns:
- the result of the evaluation, in the form of a SequenceIterator
- Throws:
XPathException
- if a dynamic error occurs during the evaluation of the expression
-
exportAttributes
Description copied from class:SystemFunction
Export any context attributes held within the SystemFunction object. The implementation will normally make one or more calls on out.emitAttribute(name, value).- Overrides:
exportAttributes
in classSystemFunction
- Parameters:
out
- the export destination
-
importAttributes
Import any attributes found in the export file, that is, any attributes output using the exportAttributes method- Overrides:
importAttributes
in classSystemFunction
- Parameters:
attributes
- the attributes, as a properties object
-