RequestBodyAdvice implementation that adds support for Jackson's
@JsonView annotation declared on a Spring MVC @HttpEntity
or @RequestBody method parameter.
The deserialization view specified in the annotation will be passed in to the
org.
which will then use it to deserialize the request body with.
Note that despite @JsonView allowing for more than one class to
be specified, the use for a request body advice is only supported with
exactly one class argument. Consider the use of a composite interface.
com.fasterxml.jackson.annotation.JsonView , com.fasterxml.jackson.databind.ObjectMapper#readerWithView(Class)
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public HttpInputMessage | beforeBodyRead(HttpInputMessage
the request inputMessage, MethodParameter the target method parameter methodParameter, Type the target type, not necessarily the same as the method
parameter type, e.g. for targetType, Class<? extends HttpMessageConverter<?>> HttpEntity<String>.the converter used to deserialize the body selectedConverterType)Overrides org. Implements org. The default implementation returns the InputMessage that was passed in. |
| public boolean | supports(MethodParameter
the method parameter methodParameter, Type the target type, not necessarily the same as the method
parameter type, e.g. for targetType, Class<? extends HttpMessageConverter<?>> HttpEntity<String>.the selected converter type converterType)Implements org. Invoked first to determine if this interceptor applies. |
| JsonViewRequestBodyAdvice | back to summary |
|---|---|
| public JsonViewRequestBodyAdvice() | |
| supports | back to summary |
|---|---|
| public boolean supports(MethodParameter methodParameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) Implements org. Doc from org. Invoked first to determine if this interceptor applies.
| |