Package org.springframework.data.web
Class ProjectingJackson2HttpMessageConverter
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<T>
org.springframework.http.converter.AbstractGenericHttpMessageConverter<Object>
org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
org.springframework.data.web.ProjectingJackson2HttpMessageConverter
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,GenericHttpMessageConverter<Object>
,HttpMessageConverter<Object>
public class ProjectingJackson2HttpMessageConverter
extends MappingJackson2HttpMessageConverter
implements BeanClassLoaderAware, BeanFactoryAware
HttpMessageConverter
implementation to enable projected JSON binding to interfaces annotated with
ProjectedPayload
.- Since:
- 1.13
- Author:
- Oliver Gierke, Christoph Strobl
-
Field Summary
Fields inherited from class org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter
defaultObjectMapper
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
-
Constructor Summary
ConstructorDescriptionCreates a newProjectingJackson2HttpMessageConverter
using a defaultObjectMapper
.ProjectingJackson2HttpMessageConverter
(com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a newProjectingJackson2HttpMessageConverter
for the givenObjectMapper
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
read
(Type type, Class<?> contextClass, HttpInputMessage inputMessage) void
setBeanClassLoader
(ClassLoader classLoader) void
setBeanFactory
(BeanFactory beanFactory) Methods inherited from class org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
setJsonPrefix, setPrefixJson, writePrefix
Methods inherited from class org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter
canRead, getCharset, getContentLength, getDefaultContentType, getJavaType, getJsonEncoding, getObjectMapper, getObjectMappersForType, getSupportedMediaTypes, logWarningIfNecessary, readInternal, registerObjectMappersForType, setObjectMapper, setPrettyPrint, setSupportedMediaTypes, writeInternal, writeSuffix
Methods inherited from class org.springframework.http.converter.AbstractGenericHttpMessageConverter
canWrite, supports, write, writeInternal
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
addDefaultHeaders, canRead, canWrite, getDefaultCharset, getSupportedMediaTypes, read, setDefaultCharset, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.http.converter.HttpMessageConverter
getSupportedMediaTypes, read, write
-
Constructor Details
-
ProjectingJackson2HttpMessageConverter
public ProjectingJackson2HttpMessageConverter()Creates a newProjectingJackson2HttpMessageConverter
using a defaultObjectMapper
. -
ProjectingJackson2HttpMessageConverter
public ProjectingJackson2HttpMessageConverter(com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a newProjectingJackson2HttpMessageConverter
for the givenObjectMapper
.- Parameters:
mapper
- must not be null.
-
-
Method Details
-
setBeanClassLoader
- Specified by:
setBeanClassLoader
in interfaceBeanClassLoaderAware
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-
canRead
- Specified by:
canRead
in interfaceGenericHttpMessageConverter<Object>
- Overrides:
canRead
in classAbstractJackson2HttpMessageConverter
-
canWrite
- Specified by:
canWrite
in interfaceHttpMessageConverter<Object>
- Overrides:
canWrite
in classAbstractJackson2HttpMessageConverter
-
read
public Object read(Type type, @Nullable Class<?> contextClass, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException - Specified by:
read
in interfaceGenericHttpMessageConverter<Object>
- Overrides:
read
in classAbstractJackson2HttpMessageConverter
- Throws:
IOException
HttpMessageNotReadableException
-