|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.web.servlet.mvc.method.annotation.support.AbstractMessageConverterMethodProcessor
public abstract class AbstractMessageConverterMethodProcessor
A base class for resolving method argument values by reading from the body of a request with HttpMessageConverters and for handling method return values by writing to the response with HttpMessageConverters.
| Field Summary | |
|---|---|
protected Log |
logger
|
| Constructor Summary | |
|---|---|
protected |
AbstractMessageConverterMethodProcessor(List<HttpMessageConverter<?>> messageConverters)
|
| Method Summary | ||
|---|---|---|
protected ServletServerHttpRequest |
createInputMessage(NativeWebRequest webRequest)
Creates a new HttpInputMessage from the given NativeWebRequest. |
|
protected ServletServerHttpResponse |
createOutputMessage(NativeWebRequest webRequest)
Creates a new HttpOutputMessage from the given NativeWebRequest. |
|
protected List<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
|
readWithMessageConverters(NativeWebRequest webRequest,
MethodParameter methodParam,
Class<T> paramType)
|
|
protected
|
writeWithMessageConverters(T returnValue,
MethodParameter returnType,
NativeWebRequest webRequest)
Writes the given return value to the given web request. |
|
protected
|
writeWithMessageConverters(T returnValue,
MethodParameter returnType,
ServletServerHttpRequest inputMessage,
ServletServerHttpResponse outputMessage)
Writes the given return type to the given output message. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.web.method.support.HandlerMethodArgumentResolver |
|---|
resolveArgument, supportsParameter |
| Methods inherited from interface org.springframework.web.method.support.HandlerMethodReturnValueHandler |
|---|
handleReturnValue, supportsReturnType |
| Field Detail |
|---|
protected final Log logger
| Constructor Detail |
|---|
protected AbstractMessageConverterMethodProcessor(List<HttpMessageConverter<?>> messageConverters)
| Method Detail |
|---|
protected <T> Object readWithMessageConverters(NativeWebRequest webRequest,
MethodParameter methodParam,
Class<T> paramType)
throws IOException,
HttpMediaTypeNotSupportedException
IOException
HttpMediaTypeNotSupportedExceptionprotected ServletServerHttpRequest createInputMessage(NativeWebRequest webRequest)
HttpInputMessage from the given NativeWebRequest.
webRequest - the web request to create an input message from
protected ServletServerHttpResponse createOutputMessage(NativeWebRequest webRequest)
HttpOutputMessage from the given NativeWebRequest.
webRequest - the web request to create an output message from
protected <T> void writeWithMessageConverters(T returnValue,
MethodParameter returnType,
NativeWebRequest webRequest)
throws IOException,
HttpMediaTypeNotAcceptableException
writeWithMessageConverters(Object, MethodParameter, ServletServerHttpRequest, ServletServerHttpResponse)
IOException
HttpMediaTypeNotAcceptableException
protected <T> void writeWithMessageConverters(T returnValue,
MethodParameter returnType,
ServletServerHttpRequest inputMessage,
ServletServerHttpResponse outputMessage)
throws IOException,
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 to
IOException - thrown in case of I/O errors
HttpMediaTypeNotAcceptableException - thrown when the conditions indicated by Accept header on
the request cannot be met by the message converters
protected List<MediaType> getProducibleMediaTypes(HttpServletRequest request,
Class<?> returnValueClass)
MediaType.ALL
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||