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

JsonbHttpMessageConverter

open class JsonbHttpMessageConverter : AbstractJsonHttpMessageConverter

Implementation of org.springframework.http.converter.HttpMessageConverter that can read and write JSON using the JSON Binding API.

This converter can be used to bind to typed beans or untyped HashMaps. By default, it supports application/json and application/*+json with UTF-8 character set.

Author
Juergen Hoeller

Since
5.0

See Also
javax.json.bind.Jsonbjavax.json.bind.JsonbBuilder#setJsonb

Constructors

<init>

JsonbHttpMessageConverter()

Construct a new JsonbHttpMessageConverter with default configuration.

JsonbHttpMessageConverter(config: JsonbConfig)

Construct a new JsonbHttpMessageConverter with the given configuration.

JsonbHttpMessageConverter(jsonb: Jsonb)

Construct a new JsonbHttpMessageConverter with the given delegate.

Functions

getJsonb

open fun getJsonb(): Jsonb

Return the configured Jsonb instance for this converter.

setJsonb

open fun setJsonb(jsonb: Jsonb): Unit

Set the Jsonb instance to use. If not set, a default Jsonb instance will be created.

Setting a custom-configured Jsonb is one way to take further control of the JSON serialization process.