Class JacksonRequestConverterFunction
java.lang.Object
com.linecorp.armeria.server.annotation.JacksonRequestConverterFunction
- All Implemented Interfaces:
RequestConverterFunction
public final class JacksonRequestConverterFunction extends Object implements RequestConverterFunction
A default implementation of a
RequestConverterFunction
which converts a JSON body of
the AggregatedHttpRequest
to an object by ObjectMapper
.-
Constructor Summary
Constructors Constructor Description JacksonRequestConverterFunction()
Creates an instance with the defaultObjectMapper
.JacksonRequestConverterFunction(ObjectMapper mapper)
Creates an instance with the specifiedObjectMapper
. -
Method Summary
Modifier and Type Method Description Object
convertRequest(ServiceRequestContext ctx, AggregatedHttpRequest request, Class<?> expectedResultType)
Converts the specifiedAggregatedHttpRequest
to an object ofexpectedResultType
.
-
Constructor Details
-
JacksonRequestConverterFunction
public JacksonRequestConverterFunction()Creates an instance with the defaultObjectMapper
. -
JacksonRequestConverterFunction
Creates an instance with the specifiedObjectMapper
.
-
-
Method Details
-
convertRequest
@Nullable public Object convertRequest(ServiceRequestContext ctx, AggregatedHttpRequest request, Class<?> expectedResultType) throws ExceptionConverts the specifiedAggregatedHttpRequest
to an object ofexpectedResultType
.- Specified by:
convertRequest
in interfaceRequestConverterFunction
- Throws:
Exception
-