A2uiExecutionContext


public interface A2uiExecutionContext


Provides environment access, dynamic payload evaluation, and function execution capabilities within the scope of a specific component.

Summary

Public methods

abstract Object

Evaluates a dynamic payload.

abstract Object
executeFunction(
    @NonNull String name,
    @NonNull Map<@NonNull String, @NonNull Object> args
)

Executes a catalog function by name.

abstract @NonNull A2uiDataPath

The base data path used to resolve relative paths in this context.

default A2uiFunctionDefinition

Returns the definition of a catalog function by name, or null if not found.

abstract @NonNull T
<T extends Object> getOrCreateFunctionScopedCache(
    @NonNull A2uiFunctionDefinition functionDefinition,
    @NonNull Function0<@NonNull T> factory
)

Gets or creates a component-scoped cache for functionDefinition.

abstract Object

Resolves a value from the data model at the given path.

Public methods

evaluatePayload

Added in 1.0.0-alpha01
abstract Object evaluatePayload(Object payload)

Evaluates a dynamic payload.

Parameters
Object payload

payload to evaluate

Returns
Object

evaluated result, or null if evaluation fails

executeFunction

abstract Object executeFunction(
    @NonNull String name,
    @NonNull Map<@NonNull String, @NonNull Object> args
)

Executes a catalog function by name.

Parameters
@NonNull String name

name of the function to execute

@NonNull Map<@NonNull String, @NonNull Object> args

arguments to pass to the function

Returns
Object

result of the function execution, or null if execution fails

getDataPath

Added in 1.0.0-alpha01
abstract @NonNull A2uiDataPath getDataPath()

The base data path used to resolve relative paths in this context.

getFunctionDefinition

Added in 1.0.0-alpha01
default A2uiFunctionDefinition getFunctionDefinition(@NonNull String name)

Returns the definition of a catalog function by name, or null if not found.

Parameters
@NonNull String name

name of the function

Returns
A2uiFunctionDefinition

function definition, or null if the function is not found in the catalog

getOrCreateFunctionScopedCache

Added in 1.0.0-alpha01
abstract @NonNull T <T extends Object> getOrCreateFunctionScopedCache(
    @NonNull A2uiFunctionDefinition functionDefinition,
    @NonNull Function0<@NonNull T> factory
)

Gets or creates a component-scoped cache for functionDefinition.

Each component and functionDefinition pair gets a separate cache that persists across function invocations and data model updates. Ideal for storing the results of heavy operations that do not rely on data model values (e.g., static metadata, parsed templates, compiled regexes, etc.).

Warning: The cache does not refresh upon data model changes. Caching values that are based on the data model will result in a stale cache.

Parameters
@NonNull A2uiFunctionDefinition functionDefinition

definition identifying the cache

@NonNull Function0<@NonNull T> factory

factory to construct the cache if missing

Returns
@NonNull T

cache instance

resolveValue

Added in 1.0.0-alpha01
abstract Object resolveValue(@NonNull A2uiDataPath path)

Resolves a value from the data model at the given path.

Parameters
@NonNull A2uiDataPath path

data path to resolve

Returns
Object

resolved value, or null if value resolution fails