public abstract class AbstractMessageConverterMethodArgumentResolver extends Object implements org.springframework.web.method.support.HandlerMethodArgumentResolver
HttpMessageConverters.| Modifier and Type | Field and Description |
|---|---|
protected List<org.springframework.http.MediaType> |
allSupportedMediaTypes |
protected Log |
logger |
protected List<org.springframework.http.converter.HttpMessageConverter<?>> |
messageConverters |
| Constructor and Description |
|---|
AbstractMessageConverterMethodArgumentResolver(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
Basic constructor with converters only.
|
AbstractMessageConverterMethodArgumentResolver(List<org.springframework.http.converter.HttpMessageConverter<?>> converters,
List<Object> requestResponseBodyAdvice)
Constructor with converters and
Request~ and ResponseBodyAdvice. |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.http.server.ServletServerHttpRequest |
createInputMessage(org.springframework.web.context.request.NativeWebRequest webRequest)
Create a new
HttpInputMessage from the given NativeWebRequest. |
protected org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyAdviceChain |
getAdvice()
Return the configured
RequestBodyAdvice and
RequestBodyAdvice where each instance may be wrapped as a
ControllerAdviceBean. |
protected boolean |
isBindExceptionRequired(org.springframework.web.bind.WebDataBinder binder,
org.springframework.core.MethodParameter methodParam)
Whether to raise a fatal bind exception on validation errors.
|
protected <T> Object |
readWithMessageConverters(org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter param,
Type targetType)
Create the method argument value of the expected parameter type by reading
from the given HttpInputMessage.
|
protected <T> Object |
readWithMessageConverters(org.springframework.web.context.request.NativeWebRequest webRequest,
org.springframework.core.MethodParameter methodParam,
Type paramType)
Create the method argument value of the expected parameter type by
reading from the given request.
|
protected void |
validateIfApplicable(org.springframework.web.bind.WebDataBinder binder,
org.springframework.core.MethodParameter methodParam)
Validate the request part if applicable.
|
protected final Log logger
protected final List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters
protected final List<org.springframework.http.MediaType> allSupportedMediaTypes
public AbstractMessageConverterMethodArgumentResolver(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
protected org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyAdviceChain getAdvice()
RequestBodyAdvice and
RequestBodyAdvice where each instance may be wrapped as a
ControllerAdviceBean.protected <T> Object readWithMessageConverters(org.springframework.web.context.request.NativeWebRequest webRequest, org.springframework.core.MethodParameter methodParam, Type paramType) throws IOException, org.springframework.web.HttpMediaTypeNotSupportedException, org.springframework.http.converter.HttpMessageNotReadableException
T - the expected type of the argument value to be createdwebRequest - the current requestmethodParam - the method argumentparamType - the type of the argument value to be createdIOException - if the reading from the request failsorg.springframework.web.HttpMediaTypeNotSupportedException - if no suitable message converter is foundorg.springframework.http.converter.HttpMessageNotReadableExceptionprotected <T> Object readWithMessageConverters(org.springframework.http.HttpInputMessage inputMessage, org.springframework.core.MethodParameter param, Type targetType) throws IOException, org.springframework.web.HttpMediaTypeNotSupportedException, org.springframework.http.converter.HttpMessageNotReadableException
T - the expected type of the argument value to be createdinputMessage - the HTTP input message representing the current requestparam - the method parameter descriptor (may be null)targetType - the target type, not necessarily the same as the method
parameter type, e.g. for HttpEntity<String>.IOException - if the reading from the request failsorg.springframework.web.HttpMediaTypeNotSupportedException - if no suitable message converter is foundorg.springframework.http.converter.HttpMessageNotReadableExceptionprotected org.springframework.http.server.ServletServerHttpRequest createInputMessage(org.springframework.web.context.request.NativeWebRequest webRequest)
HttpInputMessage from the given NativeWebRequest.webRequest - the web request to create an input message fromprotected void validateIfApplicable(org.springframework.web.bind.WebDataBinder binder,
org.springframework.core.MethodParameter methodParam)
The default implementation checks for @javax.validation.Valid,
Spring's Validated,
and custom annotations whose name starts with "Valid".
binder - the DataBinder to be usedmethodParam - the method parameterisBindExceptionRequired(org.springframework.web.bind.WebDataBinder, org.springframework.core.MethodParameter)protected boolean isBindExceptionRequired(org.springframework.web.bind.WebDataBinder binder,
org.springframework.core.MethodParameter methodParam)
binder - the data binder used to perform data bindingmethodParam - the method argumenttrue if the next method argument is not of type Errors