AnnotatedHandlerAdapter class

Adapter that supports annotation-based controller handlers.

The AnnotatedHandlerAdapter is responsible for invoking controller methods annotated with Jetleaf web annotations such as:

  • @Controller
  • @RestController
  • @RequestMapping

It resolves method arguments through the DefaultMethodArgumentResolver, invokes the reflective method, and processes the return value via CompositeReturnValueHandler.

Responsibilities

  • Identify and execute AnnotatedHandlerMethod instances.
  • Use reflection to call annotated controller methods.
  • Delegate serialization, rendering, or redirection to the configured return value handlers.

Example

final adapter = AnnotatedHandlerAdapter(argResolver, returnHandler);
if (adapter.supports(handler)) {
  await adapter.handle(request, response, handler);
}

{@macro abstract_url_handler_adapter}

Inheritance

Constructors

AnnotatedHandlerAdapter(MethodArgumentResolverManager methodArgumentResolver, ReturnValueHandlerManager methodReturnValueHandler)
Adapter that supports annotation-based controller handlers.

Properties

hashCode → int
The hash code for this object.
no setterinherited
methodArgumentResolver → MethodArgumentResolverManager
The composite argument resolver responsible for resolving method parameters dynamically during handler invocation.
finalinherited
methodReturnValueHandler → ReturnValueHandlerManager
The composite return value handler that processes and writes handler results (e.g., JSON serialization, view rendering, redirects).
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

doHandle(HandlerMethod handler, Object target, ServerHttpRequest request, ServerHttpResponse response, Method method) → Future<void>
Executes the given handler method for the current HTTP request lifecycle.
inherited
handle(ServerHttpRequest request, ServerHttpResponse response, HandlerMethod handler) → Future<void>
Handles the given HandlerMethod for the provided HTTP request and response.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
supports(HandlerMethod handler) → bool
Determines whether this adapter supports the given HandlerMethod.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited