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,Function,GroundedValue,Item,Sequence
public class ApplyFn extends SystemFunction
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 Constructor Description ApplyFn()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Sequencecall(XPathContext context, Sequence[] arguments)Evaluate the expressionvoidexportAttributes(ExpressionPresenter out)Export any context attributes held within the SystemFunction object.ItemTypegetResultItemType(Expression[] args)Get the return type, given knowledge of the actual argumentsvoidimportAttributes(java.util.Properties attributes)Import any attributes found in the export file, that is, any attributes output using the exportAttributes methodbooleanisDynamicFunctionCall()Ask whether this call to fn:apply was originally written as a dynamic function callExpressionmakeOptimizedFunctionCall(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo, Expression... arguments)Allow the function to create an optimized call based on the values of the actual argumentsvoidsetDynamicFunctionCall(java.lang.String fnExpr)Say that this call to fn:apply was originally written as a dynamic function call-
Methods inherited from class net.sf.saxon.functions.SystemFunction
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, fixArguments, getArity, getCardinality, getCompilerName, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCaller
-
Methods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEquals, effectiveBooleanValue, getAnnotations, getStringValue, getStringValueCS, isArray, isMap, makeNewContext, simplify, typeCheck
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
-
Methods inherited from interface net.sf.saxon.om.Item
getLength, head, isStreamed, itemAt, iterate, reduce, subsequence
-
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
-
-
-
Method Detail
-
setDynamicFunctionCall
public void setDynamicFunctionCall(java.lang.String fnExpr)
Say that this call to fn:apply was originally written as a dynamic function call- Parameters:
fnExpr- string representation of the expression used as the dynamic call
-
isDynamicFunctionCall
public boolean isDynamicFunctionCall()
Ask whether this call to fn:apply was originally written as a dynamic function call- Returns:
- true if it was originally a dynamic function call
-
getResultItemType
public ItemType getResultItemType(Expression[] args)
Get the return type, given knowledge of the actual arguments- Overrides:
getResultItemTypein 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:SystemFunctionAllow the function to create an optimized call based on the values of the actual arguments- Overrides:
makeOptimizedFunctionCallin 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
public Sequence call(XPathContext context, Sequence[] arguments) throws XPathException
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
public void exportAttributes(ExpressionPresenter out)
Description copied from class:SystemFunctionExport any context attributes held within the SystemFunction object. The implementation will normally make one or more calls on out.emitAttribute(name, value).- Overrides:
exportAttributesin classSystemFunction- Parameters:
out- the export destination
-
importAttributes
public void importAttributes(java.util.Properties attributes)
Import any attributes found in the export file, that is, any attributes output using the exportAttributes method- Overrides:
importAttributesin classSystemFunction- Parameters:
attributes- the attributes, as a properties object
-
-