AnnotatedHandlerMethod class final
Represents a handler method discovered through annotations
such as @RequestMapping, @GetMapping, or @PostMapping.
This class encapsulates all the metadata and context required to invoke a controller method within the JetLeaf web framework. It provides access to:
- The controller’s reflective type and its annotated method.
- The associated HTTP method and supported media types.
- Optional request conditions such as headers and parameters.
- The execution context used to resolve arguments and handle return values.
Typically, instances of WebViewHandlerMethod are created internally by the framework during controller scanning and route registration.
Example
final method = WebViewHandlerMethod(
context,
definition: controllerDef,
method: userControllerMethod,
httpMethod: HttpMethod.GET,
produces: [MediaType.APPLICATION_JSON],
consumes: [MediaType.APPLICATION_JSON],
headers: ['Accept=application/json'],
params: ['id'],
);
print('Invoking: ${method.method.getName()} on ${method.getInvokingClass().getName()}');
See also
- Implemented types
- Annotations
-
- @Author.new("Evaristus Adimonyemma")
Constructors
-
AnnotatedHandlerMethod(HandlerArgumentContext _context, String _path, {required _ControllerDefinition definition, required Method method, required HttpMethod httpMethod, required List<
MediaType> produces, required List<MediaType> consumes}) - Creates a new AnnotatedHandlerMethod instance with the given metadata.
Properties
-
consumes
→ List<
MediaType> -
The list of media types this method consumes from the request.
final
- definition → _ControllerDefinition
-
The controller definition containing metadata about the declaring class.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- httpMethod → HttpMethod
-
The HTTP method associated with this handler (e.g.
GET,POST, etc).final - method → Method
-
The reflective method to invoke for handling the request.
final
-
produces
→ List<
MediaType> -
The list of media types this method produces in the response.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getContext(
) → HandlerArgumentContext -
Returns the execution context associated with this handler.
override
-
getHttpMethod(
) → HttpMethod -
The HTTP method associated with this handler (e.g.
GET,POST, etc).override -
getInvokingClass(
) → Class -
Returns the reflective
Classthat declares this handler.override -
getMethod(
) → Method? -
Returns the reflective
Methodthat declares this handler.override -
getPath(
) → String -
The path of the request as written
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited