public class RequestBodyAdvice
extends org.aoju.bus.base.spring.BaseAdvice
implements org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice
| Constructor and Description |
|---|
RequestBodyAdvice() |
| Modifier and Type | Method and Description |
|---|---|
Object |
afterBodyRead(Object body,
org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
Type targetType,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
Invoked third (and last) after the request body is converted to an Object.
|
org.springframework.http.HttpInputMessage |
beforeBodyRead(org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
Type type,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
Invoked second before the request body is read and converted.
|
Object |
handleEmptyBody(Object body,
org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
Type type,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
Invoked second (and last) if the body is empty.
|
boolean |
supports(org.springframework.core.MethodParameter parameter,
Type type,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
Invoked first to determine if this interceptor applies.
|
addAttributes, businessException, commonException, crontabException, defaultException, httpMediaTypeNotSupportedException, httpRequestMethodNotSupportedException, initBinder, instrumentException, noHandlerFoundException, ValidateExceptionpublic boolean supports(org.springframework.core.MethodParameter parameter,
Type type,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
supports in interface org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceparameter - the method parametertype - the target type, not necessarily the same as the method
parameter type, e.g. for HttpEntity<String>.converterType - the selected converter typepublic org.springframework.http.HttpInputMessage beforeBodyRead(org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
Type type,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
beforeBodyRead in interface org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceinputMessage - the requestparameter - the target method parametertype - the target type, not necessarily the same as the method
parameter type, e.g. for HttpEntity<String>.converterType - the converter used to deserialize the bodynullpublic Object afterBodyRead(Object body, org.springframework.http.HttpInputMessage inputMessage, org.springframework.core.MethodParameter parameter, Type targetType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
afterBodyRead in interface org.springframework.web.servlet.mvc.method.annotation.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 bodypublic Object handleEmptyBody(Object body, org.springframework.http.HttpInputMessage inputMessage, org.springframework.core.MethodParameter parameter, Type type, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
handleEmptyBody in interface org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvicebody - usually set to null before the first advice is calledinputMessage - the requestparameter - the method parametertype - 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.Copyright © 2019. All rights reserved.