DefaultMethodArgumentResolverManager class final
Composite implementation of MethodArgumentResolver that delegates to a chain of registered resolvers.
This acts as the central coordinator for argument resolution in JetLeaf’s request handling pipeline. When a controller method is invoked, JetLeaf uses a DefaultMethodArgumentResolverManager to:
- Iterate over all registered resolvers.
- Select the first resolver that supports a given parameter.
- Ask that resolver to provide the argument value.
Example
final composite = DefaultMethodArgumentResolverManager();
composite.addResolvers([
RequestParamResolver(),
PathVariableResolver(),
RequestBodyResolver(),
]);
final args = await composite.resolveArgsForMethod(
handlerMethod.getMethod(),
request,
response,
handlerMethod,
);
print(args.positionalArgs);
print(args.namedArgs);
Design Notes
- Supports both positional and named parameter mapping.
- Stops searching once a resolver successfully claims a parameter.
- Used internally by JetLeaf’s
HandlerMethodInvoker.
- Implemented types
- Annotations
-
- @Author.new("Evaristus Adimonyemma")
Constructors
- DefaultMethodArgumentResolverManager()
- Composite implementation of MethodArgumentResolver that delegates to a chain of registered resolvers.
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
-
addResolver(
MethodArgumentResolver resolver) → void -
Adds a single
resolverto the internal resolver chain. -
addResolvers(
Iterable< MethodArgumentResolver> resolvers) → void -
Adds multiple
resolversto the internal resolver chain. -
getHandlers(
) → List< MethodArgumentResolver> -
Returns the complete list of MethodArgumentResolvers
managed by this instance.
override
-
getPackageName(
) → String - Represents an abstraction for identifying the package that an object, resource, or service belongs to.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onReady(
) → Future< void> - Interface to be implemented by pods that require initialization logic after their properties have been set by the container.
-
resolveArgs(
Method method, ServerHttpRequest req, ServerHttpResponse res, HandlerMethod handler, [Object? ex, StackTrace? st]) → Future< ArgumentValueHolder> -
Resolves all arguments for a given controller
method.override -
resolveArgument(
Parameter param, ServerHttpRequest req, ServerHttpResponse res, HandlerMethod handler, [Object? ex, StackTrace? st]) → Future< Object?> -
setApplicationContext(
ApplicationContext applicationContext) → void -
Sets the
ApplicationContextthat this component runs in. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited