AbstractMessageConverterMethodArgumentResolver with the ability to handle method
return values by writing to the response with HttpMessageConverters.
| Modifier and Type | Field and Description |
|---|---|
| private static final List | |
| private final ContentNegotiationManager | |
| private final List | |
| private static final Type | |
| private static final Set | |
| private static final Set | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| protected | AbstractMessageConverterMethodProcessor(List<HttpMessageConverter<?>> converters)
Constructor with list of converters only. |
| protected | AbstractMessageConverterMethodProcessor(List<HttpMessageConverter<?>> converters, ContentNegotiationManager contentNegotiationManager)
Constructor with list of converters and ContentNegotiationManager. |
| protected | AbstractMessageConverterMethodProcessor(List<HttpMessageConverter<?>> converters, ContentNegotiationManager manager, List<Object> requestResponseBodyAdvice)
Constructor with list of converters and ContentNegotiationManager as well as request/response body advice instances. |
| Modifier and Type | Method and Description |
|---|---|
| private void | addContentDispositionHeader(ServletServerHttpRequest request, ServletServerHttpResponse response)
Check if the path has a file extension and whether the extension is either
on the list of |
| protected ServletServerHttpResponse | Returns: the output messagethe web request to create an output message from webRequest)Creates a new |
| private void | |
| private List | |
| private Type | getGenericType(MethodParameter returnType)
Return the generic type of the |
| private MediaType | getMostSpecificMediaType(MediaType acceptType, MediaType produceType)
Return the more specific of the acceptable and the producible media types with the q-value of the former. |
| protected List | getProducibleMediaTypes(HttpServletRequest request, Class<?> valueClass)
Returns the media types that can be produced. |
| protected List | getProducibleMediaTypes(HttpServletRequest request, Class<?> valueClass, Type targetType)
Returns the media types that can be produced. |
| protected Class | getReturnValueType(Object value, MethodParameter returnType)
Return the type of the value to be written to the response. |
| protected boolean | isResourceType(Object value, MethodParameter returnType)
Return whether the returned value or the declared return type extends |
| private MediaType | |
| private boolean | |
| private boolean | |
| protected <T> void | writeWithMessageConverters(T value, MethodParameter returnType, NativeWebRequest webRequest)
Writes the given return value to the given web request. |
| protected <T> void | writeWithMessageConverters(T
the value to write to the output message value, MethodParameter the type of the value returnType, ServletServerHttpRequest the input messages. Used to inspect the inputMessage, ServletServerHttpResponse Accept header.the output message to write to outputMessage)Writes the given return type to the given output message. |
| ALL_APPLICATION_MEDIA_TYPES | back to summary |
|---|---|
| private static final List<MediaType> ALL_APPLICATION_MEDIA_TYPES | |
| contentNegotiationManager | back to summary |
|---|---|
| private final ContentNegotiationManager contentNegotiationManager | |
| problemMediaTypes | back to summary |
|---|---|
| private final List<MediaType> problemMediaTypes | |
| RESOURCE_REGION_LIST_TYPE | back to summary |
|---|---|
| private static final Type RESOURCE_REGION_LIST_TYPE | |
| SAFE_EXTENSIONS | back to summary |
|---|---|
| private static final Set<String> SAFE_EXTENSIONS | |
| SAFE_MEDIA_BASE_TYPES | back to summary |
|---|---|
| private static final Set<String> SAFE_MEDIA_BASE_TYPES | |
| safeExtensions | back to summary |
|---|---|
| private final Set<String> safeExtensions | |
| AbstractMessageConverterMethodProcessor | back to summary |
|---|---|
| protected AbstractMessageConverterMethodProcessor(List<HttpMessageConverter<?>> converters) Constructor with list of converters only. | |
| AbstractMessageConverterMethodProcessor | back to summary |
|---|---|
| protected AbstractMessageConverterMethodProcessor(List<HttpMessageConverter<?>> converters, ContentNegotiationManager contentNegotiationManager) Constructor with list of converters and ContentNegotiationManager. | |
| AbstractMessageConverterMethodProcessor | back to summary |
|---|---|
| protected AbstractMessageConverterMethodProcessor(List<HttpMessageConverter<?>> converters, ContentNegotiationManager manager, List<Object> requestResponseBodyAdvice) Constructor with list of converters and ContentNegotiationManager as well as request/response body advice instances. | |
| addContentDispositionHeader | back to summary |
|---|---|
| private void addContentDispositionHeader(ServletServerHttpRequest request, ServletServerHttpResponse response) Check if the path has a file extension and whether the extension is either
on the list of | |
| createOutputMessage | back to summary |
|---|---|
| protected ServletServerHttpResponse createOutputMessage(NativeWebRequest webRequest) Creates a new
| |
| determineCompatibleMediaTypes | back to summary |
|---|---|
| private void determineCompatibleMediaTypes(List<MediaType> acceptableTypes, List<MediaType> producibleTypes, List<MediaType> mediaTypesToUse) | |
| getAcceptableMediaTypes | back to summary |
|---|---|
| private List | |
| getGenericType | back to summary |
|---|---|
| private Type getGenericType(MethodParameter returnType) Return the generic type of the | |
| getMostSpecificMediaType | back to summary |
|---|---|
| private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) Return the more specific of the acceptable and the producible media types with the q-value of the former. | |
| getProducibleMediaTypes | back to summary |
|---|---|
| protected List Returns the media types that can be produced.
| |
| getProducibleMediaTypes | back to summary |
|---|---|
| protected List Returns the media types that can be produced. The resulting media types are:
| |
| getReturnValueType | back to summary |
|---|---|
| protected Class Return the type of the value to be written to the response. Typically this is
a simple check via getClass on the value but if the value is null, then the
return type needs to be examined possibly including generic type determination
(e.g. | |
| isResourceType | back to summary |
|---|---|
| protected boolean isResourceType(Object value, MethodParameter returnType) Return whether the returned value or the declared return type extends | |
| resolveMediaType | back to summary |
|---|---|
private MediaType resolveMediaType(ServletRequest request, String extension)
| |
| safeExtension | back to summary |
|---|---|
private boolean safeExtension(HttpServletRequest request, String extension)
| |
| safeMediaType | back to summary |
|---|---|
| private boolean safeMediaType(MediaType mediaType) | |
| writeWithMessageConverters | back to summary |
|---|---|
| protected <T> void writeWithMessageConverters(T value, MethodParameter returnType, NativeWebRequest webRequest) throws IOException, HttpMediaTypeNotAcceptableException, HttpMessageNotWritableException Writes the given return value to the given web request. Delegates to
| |
| writeWithMessageConverters | back to summary |
|---|---|
| protected <T> void writeWithMessageConverters(T value, MethodParameter returnType, ServletServerHttpRequest inputMessage, ServletServerHttpResponse outputMessage) throws IOException, HttpMediaTypeNotAcceptableException, HttpMessageNotWritableException Writes the given return type to the given output message.
| |