Class KotlinSerializationJsonMessageConverter
java.lang.Object
org.springframework.messaging.converter.AbstractMessageConverter
org.springframework.messaging.converter.AbstractJsonMessageConverter
org.springframework.messaging.converter.KotlinSerializationJsonMessageConverter
- All Implemented Interfaces:
MessageConverter
,SmartMessageConverter
Implementation of
MessageConverter
that can read and write JSON
using kotlinx.serialization.
This converter can be used to bind @Serializable
Kotlin classes.
- Since:
- 5.3
- Author:
- Sebastien Deleuze
-
Field Summary
Fields inherited from class org.springframework.messaging.converter.AbstractMessageConverter
logger
-
Constructor Summary
ConstructorDescriptionConstruct a newKotlinSerializationJsonMessageConverter
with default configuration.KotlinSerializationJsonMessageConverter
(kotlinx.serialization.json.Json json) Construct a newKotlinSerializationJsonMessageConverter
with the given delegate. -
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
-
KotlinSerializationJsonMessageConverter
public KotlinSerializationJsonMessageConverter()Construct a newKotlinSerializationJsonMessageConverter
with default configuration. -
KotlinSerializationJsonMessageConverter
public KotlinSerializationJsonMessageConverter(kotlinx.serialization.json.Json json) Construct a newKotlinSerializationJsonMessageConverter
with the given delegate.- Parameters:
json
- the Json instance to use
-
-
Method Details
-
fromJson
- Specified by:
fromJson
in classAbstractJsonMessageConverter
-
fromJson
- Specified by:
fromJson
in classAbstractJsonMessageConverter
-
toJson
- Specified by:
toJson
in classAbstractJsonMessageConverter
- Throws:
IOException
-
toJson
- Specified by:
toJson
in classAbstractJsonMessageConverter
-