public class HttpEntityMethodProcessor extends AbstractMessageConverterMethodProcessor
HttpEntity and RequestEntity method argument values
and also handles HttpEntity and ResponseEntity return values.
An HttpEntity return type has a specific purpose. Therefore this
handler should be configured ahead of handlers that support any return
value type annotated with @ModelAttribute or @ResponseBody
to ensure they don't take over.
allSupportedMediaTypes, logger, messageConverters| Constructor and Description |
|---|
HttpEntityMethodProcessor(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
Basic constructor with converters only.
|
HttpEntityMethodProcessor(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> converters,
org.springframework.web.accept.ContentNegotiationManager manager)
Basic constructor with converters and
ContentNegotiationManager. |
HttpEntityMethodProcessor(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> converters,
org.springframework.web.accept.ContentNegotiationManager manager,
java.util.List<java.lang.Object> requestResponseBodyAdvice)
Complete constructor for resolving
HttpEntity and handling
ResponseEntity. |
HttpEntityMethodProcessor(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> converters,
java.util.List<java.lang.Object> requestResponseBodyAdvice)
Complete constructor for resolving
HttpEntity method arguments. |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Class<?> |
getReturnValueType(java.lang.Object returnValue,
org.springframework.core.MethodParameter returnType)
Return the type of the value to be written to the response.
|
void |
handleReturnValue(java.lang.Object returnValue,
org.springframework.core.MethodParameter returnType,
org.springframework.web.method.support.ModelAndViewContainer mavContainer,
org.springframework.web.context.request.NativeWebRequest webRequest) |
java.lang.Object |
resolveArgument(org.springframework.core.MethodParameter parameter,
org.springframework.web.method.support.ModelAndViewContainer mavContainer,
org.springframework.web.context.request.NativeWebRequest webRequest,
org.springframework.web.bind.support.WebDataBinderFactory binderFactory) |
boolean |
supportsParameter(org.springframework.core.MethodParameter parameter) |
boolean |
supportsReturnType(org.springframework.core.MethodParameter returnType) |
createOutputMessage, getProducibleMediaTypes, getProducibleMediaTypes, writeWithMessageConverters, writeWithMessageConvertersadaptArgumentIfNecessary, createInputMessage, getAdvice, isBindExceptionRequired, readWithMessageConverters, readWithMessageConverters, validateIfApplicablepublic HttpEntityMethodProcessor(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
HttpEntity. For handling ResponseEntity consider also
providing a ContentNegotiationManager.public HttpEntityMethodProcessor(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> converters,
org.springframework.web.accept.ContentNegotiationManager manager)
ContentNegotiationManager.
Suitable for resolving HttpEntity and handling ResponseEntity
without Request~ or ResponseBodyAdvice.public HttpEntityMethodProcessor(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> converters,
java.util.List<java.lang.Object> requestResponseBodyAdvice)
HttpEntity method arguments.
For handling ResponseEntity consider also providing a
ContentNegotiationManager.public HttpEntityMethodProcessor(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> converters,
org.springframework.web.accept.ContentNegotiationManager manager,
java.util.List<java.lang.Object> requestResponseBodyAdvice)
HttpEntity and handling
ResponseEntity.public boolean supportsParameter(org.springframework.core.MethodParameter parameter)
public boolean supportsReturnType(org.springframework.core.MethodParameter returnType)
public java.lang.Object resolveArgument(org.springframework.core.MethodParameter parameter,
org.springframework.web.method.support.ModelAndViewContainer mavContainer,
org.springframework.web.context.request.NativeWebRequest webRequest,
org.springframework.web.bind.support.WebDataBinderFactory binderFactory)
throws java.io.IOException,
org.springframework.web.HttpMediaTypeNotSupportedException
java.io.IOExceptionorg.springframework.web.HttpMediaTypeNotSupportedExceptionpublic void handleReturnValue(java.lang.Object returnValue,
org.springframework.core.MethodParameter returnType,
org.springframework.web.method.support.ModelAndViewContainer mavContainer,
org.springframework.web.context.request.NativeWebRequest webRequest)
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.Class<?> getReturnValueType(java.lang.Object returnValue,
org.springframework.core.MethodParameter returnType)
AbstractMessageConverterMethodProcessorResponseEntity<T>).getReturnValueType in class AbstractMessageConverterMethodProcessor