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 type,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
在请求体转换为对象之后调用第三个(也是最后一个).
|
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)
在读取和转换请求体之前调用.
|
Object |
handleEmptyBody(Object body,
org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
Type type,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
如果主体为空,则调用第二个(也是最后一个).
|
boolean |
supports(org.springframework.core.MethodParameter parameter,
Type type,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
首次调用,以确定是否应用此拦截.
|
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 - 方法参数type - 目标类型,不一定与方法相同
参数类型,例如 HttpEntity<String>.converterType - 转换器类型public 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 - HTTP输入消息parameter - 方法参数type - 目标类型,不一定与方法相同
参数类型,例如 HttpEntity<String>.converterType - 转换器类型nullpublic Object afterBodyRead(Object body, org.springframework.http.HttpInputMessage inputMessage, org.springframework.core.MethodParameter parameter, Type type, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
afterBodyRead in interface org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvicebody - 在调用第一个通知之前将其设置为转换器对象inputMessage - HTTP输入消息parameter - 方法参数type - 目标类型,不一定与方法相同
参数类型,例如 HttpEntity<String>.converterType - 转换器类型public 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 - 通常在调用第一个通知之前将其设置为nullinputMessage - HTTP输入消息parameter - 方法参数type - 目标类型,不一定与方法相同
参数类型,例如 HttpEntity<String>.converterType - 转换器类型null,该值可能会引发HttpMessageNotReadableException.Copyright © 2019. All rights reserved.