spring-framework / org.springframework.http.converter.json / MappingJacksonValue

MappingJacksonValue

open class MappingJacksonValue

A simple holder for the POJO to serialize via MappingJackson2HttpMessageConverter along with further serialization instructions to be passed in to the converter.

On the server side this wrapper is added with a ResponseBodyInterceptor after content negotiation selects the converter to use but before the write.

On the client side, simply wrap the POJO and pass it in to the RestTemplate.

Author
Rossen Stoyanchev

Since
4.1

Constructors

<init>

MappingJacksonValue(value: Any)

Create a new instance wrapping the given POJO to be serialized.

Functions

getFilters

open fun getFilters(): FilterProvider

Return the Jackson filter provider to use.

getJsonpFunction

open fun getJsonpFunction(): String

Return the configured JSONP function name.

getSerializationView

open fun getSerializationView(): Class<*>

Return the serialization view to use.

getValue

open fun getValue(): Any

Return the POJO that needs to be serialized.

setFilters

open fun setFilters(filters: FilterProvider): Unit

Set the Jackson filter provider to serialize the POJO with.

setJsonpFunction

open fun setJsonpFunction(functionName: String): Unit

Set the name of the JSONP function name.

setSerializationView

open fun setSerializationView(serializationView: Class<*>): Unit

Set the serialization view to serialize the POJO with.

setValue

open fun setValue(value: Any): Unit

Modify the POJO to serialize.