public abstract class RequestBodyAdviceAdapter extends java.lang.Object implements RequestBodyAdvice
ResponseBodyAdvice
with default method implementations.
Sub-classes are required to implement RequestBodyAdvice.supports(org.springframework.core.MethodParameter, java.lang.reflect.Type, java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>>)
to return true
depending on when the advice applies.
Constructor and Description |
---|
RequestBodyAdviceAdapter() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
afterBodyRead(java.lang.Object body,
HttpInputMessage inputMessage,
MethodParameter parameter,
java.lang.reflect.Type targetType,
java.lang.Class<? extends HttpMessageConverter<?>> converterType)
The default implementation returns the body that was passed in.
|
HttpInputMessage |
beforeBodyRead(HttpInputMessage inputMessage,
MethodParameter parameter,
java.lang.reflect.Type targetType,
java.lang.Class<? extends HttpMessageConverter<?>> converterType)
The default implementation returns the InputMessage that was passed in.
|
java.lang.Object |
handleEmptyBody(java.lang.Object body,
HttpInputMessage inputMessage,
MethodParameter parameter,
java.lang.reflect.Type targetType,
java.lang.Class<? extends HttpMessageConverter<?>> converterType)
The default implementation returns the body that was passed in.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
supports
public java.lang.Object handleEmptyBody(java.lang.Object body, HttpInputMessage inputMessage, MethodParameter parameter, java.lang.reflect.Type targetType, java.lang.Class<? extends HttpMessageConverter<?>> converterType)
handleEmptyBody
in interface RequestBodyAdvice
body
- set to null
before the first advice is calledinputMessage
- the requestparameter
- the method parametertargetType
- the target type, not necessarily the same as the method
parameter type, e.g. for HttpEntity<String>
.converterType
- the selected converter typenull
which may then raise an
HttpMessageNotReadableException
if the argument is required.public HttpInputMessage beforeBodyRead(HttpInputMessage inputMessage, MethodParameter parameter, java.lang.reflect.Type targetType, java.lang.Class<? extends HttpMessageConverter<?>> converterType) throws java.io.IOException
beforeBodyRead
in interface RequestBodyAdvice
inputMessage
- the requestparameter
- the target method parametertargetType
- the target type, not necessarily the same as the method
parameter type, e.g. for HttpEntity<String>
.converterType
- the converter used to deserialize the bodynull
java.io.IOException
public java.lang.Object afterBodyRead(java.lang.Object body, HttpInputMessage inputMessage, MethodParameter parameter, java.lang.reflect.Type targetType, java.lang.Class<? extends HttpMessageConverter<?>> converterType)
afterBodyRead
in interface RequestBodyAdvice
body
- set to the converter Object before the 1st advice is calledinputMessage
- the requestparameter
- the target method parametertargetType
- the target type, not necessarily the same as the method
parameter type, e.g. for HttpEntity<String>
.converterType
- the converter used to deserialize the body