Package org.actioncontroller
ApiControllerAction for each method annotated with
a "routing mapper annotation" such as GET. Example
public class TestController {
@Get("/uppercase")
@ContentBody
public String upcase(@RequestParam("myParam") String parameter) {
return parameter.toUpperCase();
}
}
In this example, GET is a routing mapper annotation because it is
annotated HttpRouterMapping. This annotation refers to
GET.ActionFactory and GET.ActionFactory.create(org.actioncontroller.actions.GET, java.lang.Object, java.lang.reflect.Method, org.actioncontroller.ApiControllerContext)
is used to create an ApiControllerMethodAction.
ApiControllerMethodAction uses the RequestParam
annotation on the parameter to decide how this parameter is mapped from the request. RequestParam
is annotated with HttpParameterMapping, which refers to
RequestParam.MapperFactory. RequestParam.MapperFactory
again is used to create a HttpParameterMapper which extracts the method argument
from the http request.
ApiControllerMethodAction further uses the ContentBody
annotation on the method to determine how the return value is mapped the the response. ContentBody
is annotated with HttpReturnMapping, which refers to
ContentBody.MapperFactory. ContentBody.MapperFactory
is used to create a HttpReturnMapper which converts the method return value to
the http response.
A controller can be used in three contexts:
- With
ApiServletto extract actions to be used in a servlet container - With
ApiHandlerto extract actions to be used withHttpServer - With
ApiClientProxyto extract actions to call a REST service via HTTP
-
Interface Summary Interface Description ApiControllerAction The core of the framework.ApiHttpExchange Abstracts the interaction with the http request and response.ApiHttpExchange.OutputStreamConsumer ApiHttpExchange.WriterConsumer TimerRegistry An extension point for measuring the execution of actions.TimerRegistry.Timer UserContext -
Class Summary Class Description ActionControllerCookie RFC 6265 compliant http cookie parser and generator future-proof for future attributesApiControllerActionRouter A collection of ApiControllerActions which allows for routingApiControllerContext Extra initialization variables for the ActionControllers.ApiControllerMethodAction Represents a single action that can be performed on a controller.ApiControllerRouteMap