Defines the contract for a handler execution context, which stores and provides access to method invocation data within the JetLeaf request-handling pipeline.
A HandlerArgumentContext encapsulates runtime state for a single handler invocation — including argument values, intermediate attributes, and objects that may need to be accessed by return value resolvers, interceptors, or view renderers.
Responsibilities
- Provide access to resolved handler arguments (getArgs)
- Allow attribute-style retrieval of named or typed values (get, getAs)
- Maintain request-scoped state during the handler lifecycle
Typical Usage
The execution context is created internally by the dispatcher before invoking a controller or handler method:
final context = DefaultHandlerExecutionContext();
context.setArgs(resolvedArgs);
final userId = context.get('id');
final model = context.getAs<Model>();
Extension Points
- Implementations may add lifecycle hooks or tracking logic.
- The context is passed downstream to components such as
HandlerMethodReturnValueResolveror ExceptionResolver.
- Implementers
- Annotations
-
- @Author.new("Evaristus Adimonyemma")
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
get(
[String? name]) → Object? - Retrieves a value from the context.
-
getArgs(
) → ArgumentValueHolder -
Returns the current
ArgumentValueHolder, which stores the resolved method arguments. -
getAs<
T> ([String? name]) → T? -
Retrieves a value of the specified type
Tfrom the context. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setArgs(
ArgumentValueHolder valueHolder) → void -
Replaces the current
ArgumentValueHolderwith a new instance. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited