Class JsonbMessageConverter
java.lang.Object
org.springframework.messaging.converter.AbstractMessageConverter
org.springframework.messaging.converter.AbstractJsonMessageConverter
org.springframework.messaging.converter.JsonbMessageConverter
- All Implemented Interfaces:
MessageConverter
,SmartMessageConverter
Implementation of
MessageConverter
that can read and write JSON
using the JSON Binding API.- Since:
- 5.3
- Author:
- Juergen Hoeller
- See Also:
-
Field Summary
Fields inherited from class org.springframework.messaging.converter.AbstractMessageConverter
logger
-
Constructor Summary
ConstructorDescriptionConstruct a newJsonbMessageConverter
with default configuration.JsonbMessageConverter
(Jsonb jsonb) Construct a newJsonbMessageConverter
with the given delegate.JsonbMessageConverter
(JsonbConfig config) Construct a newJsonbMessageConverter
with the given configuration. -
Method Summary
Methods inherited from class org.springframework.messaging.converter.AbstractJsonMessageConverter
convertFromInternal, convertToInternal, supports
Methods inherited from class org.springframework.messaging.converter.AbstractMessageConverter
addSupportedMimeTypes, canConvertFrom, canConvertTo, fromMessage, fromMessage, getContentTypeResolver, getDefaultContentType, getMimeType, getSerializedPayloadClass, getSupportedMimeTypes, isStrictContentTypeMatch, setContentTypeResolver, setSerializedPayloadClass, setStrictContentTypeMatch, supportsMimeType, toMessage, toMessage
-
Constructor Details
-
JsonbMessageConverter
public JsonbMessageConverter()Construct a newJsonbMessageConverter
with default configuration. -
JsonbMessageConverter
Construct a newJsonbMessageConverter
with the given configuration.- Parameters:
config
- theJsonbConfig
for the underlying delegate
-
JsonbMessageConverter
Construct a newJsonbMessageConverter
with the given delegate.- Parameters:
jsonb
- the Jsonb instance to use
-
-
Method Details
-
setJsonb
Set theJsonb
instance to use. If not set, a defaultJsonb
instance will be created.Setting a custom-configured
Jsonb
is one way to take further control of the JSON serialization process. -
getJsonb
Return the configuredJsonb
instance for this converter. -
fromJson
- Specified by:
fromJson
in classAbstractJsonMessageConverter
-
fromJson
- Specified by:
fromJson
in classAbstractJsonMessageConverter
-
toJson
- Specified by:
toJson
in classAbstractJsonMessageConverter
-
toJson
- Specified by:
toJson
in classAbstractJsonMessageConverter
-