RequestBodyAdvice and ResponseBodyAdvice where each
instance may be (and is most likely) wrapped with
ControllerAdviceBean.
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | RequestResponseBodyAdviceChain(List<Object> requestResponseBodyAdvice)
Create an instance from a list of objects that are either of type
|
| Modifier and Type | Method and Description |
|---|---|
| public Object | afterBodyRead(Object
set 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)Implements org. Invoked third (and last) after the request body is converted to an Object. |
| public HttpInputMessage | beforeBodyRead(HttpInputMessage
the request request, 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)Implements org. Invoked second before the request body is read and converted. |
| public Object | beforeBodyWrite(Object
the body to be written body, MethodParameter the return type of the controller method returnType, MediaType the content type selected through content negotiation contentType, Class<? extends HttpMessageConverter<?>> the converter type selected to write to the response converterType, ServerHttpRequest the current request request, ServerHttpResponse the current response response)Implements org. Invoked after an |
| private List | |
| pack-priv static <T> List | |
| private <A> List | |
| public Object | handleEmptyBody(Object
usually 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)Implements org. Invoked second (and last) if the body is empty. |
| private <T> Object | processBody(Object body, MethodParameter returnType, MediaType contentType, Class<? extends HttpMessageConverter<?>> converterType, ServerHttpRequest request, ServerHttpResponse response)
|
| public boolean | supports(MethodParameter
the method parameter param, Type the target type, not necessarily the same as the method
parameter type, e.g. for type, Class<? extends HttpMessageConverter<?>> HttpEntity<String>.the selected converter type converterType)Implements org. Invoked first to determine if this interceptor applies. |
| public boolean | supports(MethodParameter
the return type returnType, Class<? extends HttpMessageConverter<?>> the selected converter type converterType)Implements org. Whether this component supports the given controller method return type
and the selected |
| requestBodyAdvice | back to summary |
|---|---|
| private final List<Object> requestBodyAdvice | |
| responseBodyAdvice | back to summary |
|---|---|
| private final List<Object> responseBodyAdvice | |
| RequestResponseBodyAdviceChain | back to summary |
|---|---|
| public RequestResponseBodyAdviceChain(List<Object> requestResponseBodyAdvice) Create an instance from a list of objects that are either of type
| |
| afterBodyRead | back to summary |
|---|---|
| public Object afterBodyRead(Object body, HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) Implements org. Doc from org. Invoked third (and last) after the request body is converted to an Object.
| |
| beforeBodyRead | back to summary |
|---|---|
| public HttpInputMessage beforeBodyRead(HttpInputMessage request, MethodParameter parameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) throws IOException Implements org. Doc from org. Invoked second before the request body is read and converted.
| |
| beforeBodyWrite | back to summary |
|---|---|
| public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType contentType, Class<? extends HttpMessageConverter<?>> converterType, ServerHttpRequest request, ServerHttpResponse response) Implements org. Doc from org. Invoked after an
| |
| getAdvice | back to summary |
|---|---|
| private List | |
| getAdviceByType | back to summary |
|---|---|
pack-priv static <T> List
| |
| getMatchingAdvice | back to summary |
|---|---|
private <A> List
| |
| handleEmptyBody | back to summary |
|---|---|
| public Object handleEmptyBody(Object body, HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, Class<? extends HttpMessageConverter<?>> converterType) Implements org. Doc from org. Invoked second (and last) if the body is empty.
| |
| processBody | back to summary |
|---|---|
private <T> Object processBody(Object body, MethodParameter returnType, MediaType contentType, Class<? extends HttpMessageConverter<?>> converterType, ServerHttpRequest request, ServerHttpResponse response)
| |
| supports | back to summary |
|---|---|
| public boolean supports(MethodParameter param, Type type, Class<? extends HttpMessageConverter<?>> converterType) Implements org. Doc from org. Invoked first to determine if this interceptor applies.
| |
| supports | back to summary |
|---|---|
| public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) Implements org. Doc from org. Whether this component supports the given controller method return type
and the selected
| |