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

`DEFAULT_CHARSET, objectMapper`

### Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter

`logger`

### Constructor Summary

Constructors
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`.

### Method Summary

All Methods Instance Methods Concrete Methods
`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)`

### 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, logWarningIfNecessary, readInternal, setObjectMapper, setPrettyPrint, 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, setSupportedMediaTypes, 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 Detail

#### ProjectingJackson2HttpMessageConverter

    public ProjectingJackson2HttpMessageConverter()

Creates a new `ProjectingJackson2HttpMessageConverter` using a default `ObjectMapper`.

#### ProjectingJackson2HttpMessageConverter

    public ProjectingJackson2HttpMessageConverter(com.fasterxml.jackson.databind.ObjectMapper mapper)

Creates a new `ProjectingJackson2HttpMessageConverter` for the given `ObjectMapper`.

Parameters:
  `mapper` - must not be null.

### Method Detail

#### setBeanClassLoader

    public void setBeanClassLoader(ClassLoader classLoader)

Specified by:
  `setBeanClassLoader` in interface `BeanClassLoaderAware`

#### setBeanFactory

    public void setBeanFactory(BeanFactory beanFactory)
                        throws BeansException

Specified by:
  `setBeanFactory` in interface `BeanFactoryAware`
Throws:
  `BeansException`

#### canRead

    public boolean canRead(Type type,
                           @Nullable
                           Class<?> contextClass,
                           @Nullable
                           MediaType mediaType)

Specified by:
  `canRead` in interface `GenericHttpMessageConverter<Object>`
Overrides:
  `canRead` in class `AbstractJackson2HttpMessageConverter`

#### canWrite

    public boolean canWrite(Class<?> clazz,
                            @Nullable
                            MediaType mediaType)

Specified by:
  `canWrite` in interface `HttpMessageConverter<Object>`
Overrides:
  `canWrite` in class `AbstractJackson2HttpMessageConverter`

#### read

    public Object read(Type type,
                       @Nullable
                       Class<?> contextClass,
                       HttpInputMessage inputMessage)
                throws IOException,
                       HttpMessageNotReadableException

Specified by:
  `read` in interface `GenericHttpMessageConverter<Object>`
Overrides:
  `read` in class `AbstractJackson2HttpMessageConverter`
Throws:
  `IOException`
  `HttpMessageNotReadableException`