public class JsonbMessageConverter extends AbstractJsonMessageConverter
MessageConverter
that can read and write JSON
using the JSON Binding API.Jsonb
,
JsonbBuilder
,
setJsonb(javax.json.bind.Jsonb)
logger
Constructor and Description |
---|
JsonbMessageConverter()
Construct a new
JsonbMessageConverter with default configuration. |
JsonbMessageConverter(javax.json.bind.Jsonb jsonb)
Construct a new
JsonbMessageConverter with the given delegate. |
JsonbMessageConverter(javax.json.bind.JsonbConfig config)
Construct a new
JsonbMessageConverter with the given configuration. |
Modifier and Type | Method and Description |
---|---|
protected Object |
fromJson(Reader reader,
Type resolvedType) |
protected Object |
fromJson(String payload,
Type resolvedType) |
javax.json.bind.Jsonb |
getJsonb()
Return the configured
Jsonb instance for this converter. |
void |
setJsonb(javax.json.bind.Jsonb jsonb)
Set the
Jsonb instance to use. |
protected String |
toJson(Object payload,
Type resolvedType) |
protected void |
toJson(Object payload,
Type resolvedType,
Writer writer) |
convertFromInternal, convertToInternal, supports
addSupportedMimeTypes, canConvertFrom, canConvertTo, fromMessage, fromMessage, getContentTypeResolver, getDefaultContentType, getMimeType, getSerializedPayloadClass, getSupportedMimeTypes, isStrictContentTypeMatch, setContentTypeResolver, setSerializedPayloadClass, setStrictContentTypeMatch, supportsMimeType, toMessage, toMessage
public JsonbMessageConverter()
JsonbMessageConverter
with default configuration.public JsonbMessageConverter(javax.json.bind.JsonbConfig config)
JsonbMessageConverter
with the given configuration.config
- the JsonbConfig
for the underlying delegatepublic JsonbMessageConverter(javax.json.bind.Jsonb jsonb)
JsonbMessageConverter
with the given delegate.jsonb
- the Jsonb instance to usepublic void setJsonb(javax.json.bind.Jsonb jsonb)
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.
public javax.json.bind.Jsonb getJsonb()
Jsonb
instance for this converter.protected Object fromJson(Reader reader, Type resolvedType)
fromJson
in class AbstractJsonMessageConverter
protected Object fromJson(String payload, Type resolvedType)
fromJson
in class AbstractJsonMessageConverter
protected void toJson(Object payload, Type resolvedType, Writer writer)
toJson
in class AbstractJsonMessageConverter
protected String toJson(Object payload, Type resolvedType)
toJson
in class AbstractJsonMessageConverter