public class ProjectingJackson2HttpMessageConverter
extends org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware
HttpMessageConverter
implementation to enable projected JSON binding to interfaces annotated with
ProjectedPayload
.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,
org.springframework.http.MediaType mediaType) |
boolean |
canWrite(Class<?> clazz,
org.springframework.http.MediaType mediaType) |
Object |
read(Type type,
Class<?> contextClass,
org.springframework.http.HttpInputMessage inputMessage) |
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
setBeanFactory(org.springframework.beans.factory.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
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 org.springframework.beans.factory.BeanClassLoaderAware
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
public 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.AbstractJackson2HttpMessageConverter
public 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.AbstractJackson2HttpMessageConverter
public Object read(Type type, Class<?> contextClass, org.springframework.http.HttpInputMessage inputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotReadableException
read
in interface org.springframework.http.converter.GenericHttpMessageConverter<Object>
read
in class org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter
IOException
org.springframework.http.converter.HttpMessageNotReadableException
Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.