public class TypeConstrainedMappingJackson2HttpMessageConverter
extends org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
MappingJackson2HttpMessageConverter to constrain the ability to read and write HTTP message
based on the target type. Useful in case the ObjectMapper about to be configured has customizations that
shall only be applied to object trees of a certain base type.| Constructor and Description |
|---|
TypeConstrainedMappingJackson2HttpMessageConverter(Class<?> type)
Creates a new
TypeConstrainedMappingJackson2HttpMessageConverter for the given type. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead(Class<?> clazz,
org.springframework.http.MediaType mediaType) |
boolean |
canRead(Type type,
Class<?> contextClass,
org.springframework.http.MediaType mediaType) |
boolean |
canWrite(Class<?> clazz,
org.springframework.http.MediaType mediaType) |
setJsonPrefix, setPrefixJson, writePrefix, writeSuffixgetContentLength, getDefaultContentType, getJavaType, getJsonEncoding, getObjectMapper, init, logWarningIfNecessary, read, readInternal, setObjectMapper, setPrettyPrint, writeInternalcanWrite, supports, write, writeInternaladdDefaultHeaders, canRead, canWrite, getDefaultCharset, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, writepublic TypeConstrainedMappingJackson2HttpMessageConverter(Class<?> type)
TypeConstrainedMappingJackson2HttpMessageConverter for the given type.type - must not be null.public boolean canRead(Class<?> clazz, org.springframework.http.MediaType mediaType)
canRead in interface org.springframework.http.converter.HttpMessageConverter<Object>canRead in class org.springframework.http.converter.json.AbstractJackson2HttpMessageConverterpublic boolean canRead(Type type, Class<?> contextClass, org.springframework.http.MediaType mediaType)
canRead in interface org.springframework.http.converter.GenericHttpMessageConverter<Object>canRead in class org.springframework.http.converter.json.AbstractJackson2HttpMessageConverterpublic boolean canWrite(Class<?> clazz, org.springframework.http.MediaType mediaType)
canWrite in interface org.springframework.http.converter.HttpMessageConverter<Object>canWrite in class org.springframework.http.converter.json.AbstractJackson2HttpMessageConverterCopyright © 2012-2016–2018 Pivotal, Inc.. All rights reserved.