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, waitsupportspublic HttpInputMessage beforeBodyRead(HttpInputMessage inputMessage, MethodParameter parameter, java.lang.reflect.Type targetType, java.lang.Class<? extends HttpMessageConverter<?>> converterType) throws java.io.IOException
beforeBodyRead in interface RequestBodyAdviceinputMessage - 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 bodynulljava.io.IOExceptionpublic 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 RequestBodyAdvicebody - set to the converter Object before the first 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@Nullable public java.lang.Object handleEmptyBody(@Nullable java.lang.Object body, HttpInputMessage inputMessage, MethodParameter parameter, java.lang.reflect.Type targetType, java.lang.Class<? extends HttpMessageConverter<?>> converterType)
handleEmptyBody in interface RequestBodyAdvicebody - usually 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.