Annotation Interface RequestConverter
@Repeatable(RequestConverters.class)
@Retention(RUNTIME)
@Target({TYPE,METHOD,PARAMETER,CONSTRUCTOR,FIELD})
public @interface RequestConverter
Specifies a
RequestConverterFunction
class which converts an AggregatedHttpRequest
to
an object.
It can be specified on a class, a method and a parameter in an annotated service. Its scope is determined by where it is specified, e.g.
> @RequestConverter(AliceConverter.class)
> @RequestConverter(BobConverter.class)
> public class MyService {
>
> @Get("/general")
> @RequestConverter(CarolConverter.class)
> public HttpResponse general(Alice a, Bob b, Carol c) {
> // Try CarolConverter, AliceConverter and BobConverter in order, for converting each parameter.
> }
>
> @Get("/special")
> public HttpResponse special(@RequestConverter(SuperAliceConverter.class) Alice a, Bob b) {
> // Try SuperAliceConverter, AliceConverter and BobConverter in order, for converting parameter 'a'.
> // Try AliceConverter and BobConverter in order, for converting parameter 'b'.
> }
> }
- See Also:
RequestConverterFunction
,RequestObject
-
Required Element Summary
Modifier and TypeRequired ElementDescriptionClass<? extends RequestConverterFunction>
RequestConverterFunction
implementation type.
-
Element Details
-
value
Class<? extends RequestConverterFunction> valueRequestConverterFunction
implementation type. The specified class must have an accessible default constructor.
-