public class ProjectingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter implements BeanClassLoaderAware, BeanFactoryAware
HttpMessageConverter
implementation to enable projected JSON binding to interfaces annotated with
ProjectedPayload
.DEFAULT_CHARSET, objectMapper
logger
Constructor and Description |
---|
ProjectingJackson2HttpMessageConverter()
Creates a new
ProjectingJackson2HttpMessageConverter using a default ObjectMapper . |
ProjectingJackson2HttpMessageConverter(com.fasterxml.jackson.databind.ObjectMapper mapper)
Creates a new
ProjectingJackson2HttpMessageConverter for the given ObjectMapper . |
Modifier and Type | Method and Description |
---|---|
boolean |
canRead(Type type,
Class<?> contextClass,
MediaType mediaType) |
boolean |
canWrite(Class<?> clazz,
MediaType mediaType) |
Object |
read(Type type,
Class<?> contextClass,
HttpInputMessage inputMessage) |
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
setBeanFactory(BeanFactory beanFactory) |
setJsonPrefix, setPrefixJson, writePrefix, writeSuffix
canRead, getContentLength, getDefaultContentType, getJavaType, getJsonEncoding, getObjectMapper, init, logWarningIfNecessary, readInternal, setObjectMapper, setPrettyPrint, writeInternal
canWrite, supports, write, writeInternal
addDefaultHeaders, canRead, canWrite, getDefaultCharset, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSupportedMediaTypes, read, write
public ProjectingJackson2HttpMessageConverter()
ProjectingJackson2HttpMessageConverter
using a default ObjectMapper
.public ProjectingJackson2HttpMessageConverter(com.fasterxml.jackson.databind.ObjectMapper mapper)
ProjectingJackson2HttpMessageConverter
for the given ObjectMapper
.mapper
- must not be null.public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
public boolean canRead(Type type, Class<?> contextClass, MediaType mediaType)
canRead
in interface GenericHttpMessageConverter<Object>
canRead
in class AbstractJackson2HttpMessageConverter
public boolean canWrite(Class<?> clazz, MediaType mediaType)
canWrite
in interface HttpMessageConverter<Object>
canWrite
in class AbstractJackson2HttpMessageConverter
public Object read(Type type, Class<?> contextClass, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException
read
in interface GenericHttpMessageConverter<Object>
read
in class AbstractJackson2HttpMessageConverter
IOException
HttpMessageNotReadableException
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.