public final class HttpMessageConverterUtils extends Object
Modifier and Type | Method and Description |
---|---|
static org.springframework.web.accept.ContentNegotiationManager |
defaultContentNegotiationManager() |
static org.springframework.web.accept.ContentNegotiationManager |
defaultContentNegotiationManager(org.springframework.http.MediaType defaultContentType) |
static List<org.springframework.http.converter.HttpMessageConverter<?>> |
defaultHttpMessageConverters(org.springframework.core.env.PropertyResolver propertyResolver,
Object objectMapper)
Returns default
HttpMessageConverter instances, i.e.:
ByteArrayHttpMessageConverter
StringHttpMessageConverter
ResourceHttpMessageConverter
Jaxb2RootElementHttpMessageConverter (when JAXB is present)
MappingJackson2HttpMessageConverter (when Jackson 2.x is present)
{org.springframework.http.converter.json.MappingJacksonHttpMessageConverter}
(when Jackson 1.x is present and 2.x not)
|
static boolean |
isJackson2Present(ClassLoader classLoader)
Determine whether Jackson 2.x is present on the classpath and can be loaded.
|
static boolean |
isJacksonPresent(ClassLoader classLoader)
Deprecated.
|
static boolean |
isJaxb2Present(ClassLoader classLoader)
Determine whether a JAXB binder is present on the classpath and can be loaded.
|
public static boolean isJaxb2Present(ClassLoader classLoader)
Binder
or one of its dependencies is not
present or cannot be loaded.classLoader
- classLoaderpublic static boolean isJackson2Present(ClassLoader classLoader)
com.fasterxml.jackson.databind.ObjectMapper
,
com.fasterxml.jackson.core.JsonGenerator
or one of its dependencies is not present
or cannot be loaded.classLoader
- classLoader@Deprecated public static boolean isJacksonPresent(ClassLoader classLoader)
org.codehaus.jackson.map.ObjectMapper
,
org.codehaus.jackson.JsonGenerator
or one of its dependencies is not present or
cannot be loaded.classLoader
- classLoaderpublic static List<org.springframework.http.converter.HttpMessageConverter<?>> defaultHttpMessageConverters(org.springframework.core.env.PropertyResolver propertyResolver, Object objectMapper)
HttpMessageConverter
instances, i.e.:
Note: It does not return all of the default converters defined in Spring, but just thus usable for exception responses.
propertyResolver
- propertyResolverobjectMapper
- objectMapperpublic static org.springframework.web.accept.ContentNegotiationManager defaultContentNegotiationManager()
public static org.springframework.web.accept.ContentNegotiationManager defaultContentNegotiationManager(org.springframework.http.MediaType defaultContentType)
Copyright © 2017. All rights reserved.