public abstract class AbstractMessageConverterMethodProcessor extends AbstractMessageConverterMethodArgumentResolver implements org.springframework.web.method.support.HandlerMethodReturnValueHandler
AbstractMessageConverterMethodArgumentResolver with the ability to handle method return
values by writing to the response with HttpMessageConverters.allSupportedMediaTypes, logger, messageConverters| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMessageConverterMethodProcessor(List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters) |
protected |
AbstractMessageConverterMethodProcessor(List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters,
org.springframework.web.accept.ContentNegotiationManager manager) |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.http.server.ServletServerHttpResponse |
createOutputMessage(org.springframework.web.context.request.NativeWebRequest webRequest)
Creates a new
HttpOutputMessage from the given NativeWebRequest. |
protected List<org.springframework.http.MediaType> |
getProducibleMediaTypes(HttpServletRequest request,
Class<?> returnValueClass)
Returns the media types that can be produced:
The producible media types specified in the request mappings, or
Media types of configured converters that can write the specific return value, or
MediaType.ALL
|
protected <T> void |
writeWithMessageConverters(T returnValue,
org.springframework.core.MethodParameter returnType,
org.springframework.web.context.request.NativeWebRequest webRequest)
Writes the given return value to the given web request.
|
protected <T> void |
writeWithMessageConverters(T returnValue,
org.springframework.core.MethodParameter returnType,
org.springframework.http.server.ServletServerHttpRequest inputMessage,
org.springframework.http.server.ServletServerHttpResponse outputMessage)
Writes the given return type to the given output message.
|
createInputMessage, readWithMessageConverters, readWithMessageConvertersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected AbstractMessageConverterMethodProcessor(List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters)
protected AbstractMessageConverterMethodProcessor(List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters, org.springframework.web.accept.ContentNegotiationManager manager)
protected org.springframework.http.server.ServletServerHttpResponse createOutputMessage(org.springframework.web.context.request.NativeWebRequest webRequest)
HttpOutputMessage from the given NativeWebRequest.webRequest - the web request to create an output message fromprotected <T> void writeWithMessageConverters(T returnValue,
org.springframework.core.MethodParameter returnType,
org.springframework.web.context.request.NativeWebRequest webRequest)
throws IOException,
org.springframework.web.HttpMediaTypeNotAcceptableException
writeWithMessageConverters(Object, MethodParameter, ServletServerHttpRequest, ServletServerHttpResponse)IOExceptionorg.springframework.web.HttpMediaTypeNotAcceptableExceptionprotected <T> void writeWithMessageConverters(T returnValue,
org.springframework.core.MethodParameter returnType,
org.springframework.http.server.ServletServerHttpRequest inputMessage,
org.springframework.http.server.ServletServerHttpResponse outputMessage)
throws IOException,
org.springframework.web.HttpMediaTypeNotAcceptableException
returnValue - the value to write to the output messagereturnType - the type of the valueinputMessage - the input messages. Used to inspect the Accept header.outputMessage - the output message to write toIOException - thrown in case of I/O errorsorg.springframework.web.HttpMediaTypeNotAcceptableException - thrown when the conditions indicated by Accept header on
the request cannot be met by the message convertersprotected List<org.springframework.http.MediaType> getProducibleMediaTypes(HttpServletRequest request, Class<?> returnValueClass)
MediaType.ALL