java.lang.Object
dev.metaschema.core.metapath.function.CalledContext
Represents an immutable execution context for function calls in Metapath
expressions.
This class is designed to support both named and anonymous functions by maintaining the function instance, its arguments, and the current context item. It ensures thread-safety through immutability and is primarily used during the evaluation of Metapath expressions and for caching the function results.
-
Constructor Summary
ConstructorsConstructorDescriptionCalledContext(IFunction function, List<ISequence<?>> arguments, IItem contextItem) Creates an immutable execution context for a function call. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the arguments associated with the calling context.Get the node item focus associated with the calling context.Get the function instance associated with the calling context.inthashCode()
-
Constructor Details
-
CalledContext
public CalledContext(@NonNull IFunction function, @NonNull List<ISequence<?>> arguments, @Nullable IItem contextItem) Creates an immutable execution context for a function call.- Parameters:
function- the function to be executedarguments- the list of evaluated arguments as sequences, must match function's aritycontextItem- the optional context item representing the current node in scope
-
-
Method Details
-
getFunction
Get the function instance associated with the calling context.- Returns:
- the function instance
-
getContextItem
Get the node item focus associated with the calling context.- Returns:
- the context item, or null if no context is set
-
getArguments
Get the arguments associated with the calling context.- Returns:
- the arguments
-
hashCode
public int hashCode() -
equals
-