@RequestBody or an
HttpEntity method argument.
Implementations of this contract may be registered directly with the
RequestMappingHandlerAdapter or more likely annotated with
@ControllerAdvice in which case they are auto-detected.
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: the same body or a new instanceset to the converter Object before the first advice is called body, HttpInputMessage the request inputMessage, MethodParameter the target method parameter parameter, 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 converterType)Invoked third (and last) after the request body is converted to an Object. |
| public HttpInputMessage | Returns: the input request or a new instance (nevernull)the request inputMessage, MethodParameter the target method parameter parameter, 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 converterType)Invoked second before the request body is read and converted. |
| public Object | Returns: the value to use, ornull which may then raise an
HttpMessageNotReadableException if the argument is requiredusually set to body, HttpInputMessage null before the first advice is calledthe request inputMessage, MethodParameter the method parameter parameter, 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)Invoked second (and last) if the body is empty. |
| public boolean | Returns: whether this interceptor should be invoked or notthe 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)Invoked first to determine if this interceptor applies. |
| afterBodyRead | back to summary |
|---|---|
| public Object afterBodyRead(Object body, HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) Invoked third (and last) after the request body is converted to an Object.
| |
| beforeBodyRead | back to summary |
|---|---|
| public HttpInputMessage beforeBodyRead(HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) throws IOException Invoked second before the request body is read and converted.
| |
| handleEmptyBody | back to summary |
|---|---|
| public Object handleEmptyBody(Object body, HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) Invoked second (and last) if the body is empty.
| |
| supports | back to summary |
|---|---|
| public boolean supports(MethodParameter methodParameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) Invoked first to determine if this interceptor applies.
| |