java.lang.Object
dev.metaschema.core.metapath.function.impl.AbstractFunction
dev.metaschema.core.metapath.function.DefaultFunction
- All Implemented Interfaces:
IFunction,ICollectionValue,IItem
public class DefaultFunction
extends dev.metaschema.core.metapath.function.impl.AbstractFunction
Provides a concrete implementation of a function call executor.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.metaschema.core.metapath.function.IFunction
IFunction.Builder, IFunction.FunctionProperty -
Method Summary
Modifier and TypeMethodDescriptionprotected ISequence<?>executeInternal(List<ISequence<?>> arguments, DynamicContext dynamicContext, IItem focus) Execute the provided function using the provided arguments, dynamic context, and focus.Retrieve the set of assigned function properties.Retrieve the function result sequence type.booleanDetermine if the function is a named function.Methods inherited from class dev.metaschema.core.metapath.function.impl.AbstractFunction
accept, arity, convertArguments, convertSequence, equals, execute, getArguments, getQName, getValue, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.metaschema.core.metapath.function.IFunction
deepEquals, getName, getType, isArityUnbounded, isContextDepenent, isDeterministic, isFocusDependent, toAtomicItem, toSignatureMethods inherited from interface dev.metaschema.core.metapath.item.IItem
atomize, contentsAsSequence, flatten, hasValue, toSequence
-
Method Details
-
getProperties
Description copied from interface:IFunctionRetrieve the set of assigned function properties.- Returns:
- the set of properties or an empty set
-
getResult
Description copied from interface:IFunctionRetrieve the function result sequence type.- Returns:
- the function result sequence type
-
isNamedFunction
public boolean isNamedFunction()Description copied from interface:IFunctionDetermine if the function is a named function.- Returns:
trueif the function is named orfalseif the function is anonymous
-
executeInternal
@NonNull protected ISequence<?> executeInternal(@NonNull List<ISequence<?>> arguments, @NonNull DynamicContext dynamicContext, @Nullable IItem focus) Execute the provided function using the provided arguments, dynamic context, and focus.- Specified by:
executeInternalin classdev.metaschema.core.metapath.function.impl.AbstractFunction- Parameters:
arguments- the function argumentsdynamicContext- the dynamic evaluation contextfocus- the current focus item in the evaluation context. This represents the context item for anonymous function evaluation. May be null for functions that don't require context item access.- Returns:
- a sequence containing the result of the execution
- Throws:
MetapathException- if an error occurred while executing the function
-