MessageConverter that can read and write JSON
using kotlinx.serialization.
This converter can be used to bind @Serializable Kotlin classes.
| Modifier and Type | Field and Description |
|---|---|
| private final kotlinx. | |
| private static final Map |
| Access | Constructor and Description |
|---|---|
| public | KotlinSerializationJsonMessageConverter()
Construct a new |
| public | KotlinSerializationJsonMessageConverter(kotlinx.
the Json instance to use jsonConstruct a new |
| Modifier and Type | Method and Description |
|---|---|
| protected Object | fromJson(Reader reader, Type resolvedType)
Implements abstract org. |
| protected Object | fromJson(String payload, Type resolvedType)
Implements abstract org. |
| private kotlinx.serialization.KSerializer | Returns: a resolved serializer for the given typethe type to find a serializer for type)Tries to find a serializer that can marshall or unmarshall instances of the given type using kotlinx.serialization. |
| protected void | toJson(Object payload, Type resolvedType, Writer writer)
Implements abstract org. |
| protected String | toJson(Object payload, Type resolvedType)
Implements abstract org. |
| json | back to summary |
|---|---|
| private final kotlinx. | |
| serializerCache | back to summary |
|---|---|
| private static final Map<Type, kotlinx.serialization.KSerializer<Object>> serializerCache | |
| KotlinSerializationJsonMessageConverter | back to summary |
|---|---|
| public KotlinSerializationJsonMessageConverter() Construct a new | |
| KotlinSerializationJsonMessageConverter | back to summary |
|---|---|
| public KotlinSerializationJsonMessageConverter(kotlinx. Construct a new
| |
| fromJson | back to summary |
|---|---|
| protected Object fromJson(Reader reader, Type resolvedType) Implements abstract org.
| |
| fromJson | back to summary |
|---|---|
| protected Object fromJson(String payload, Type resolvedType) Implements abstract org.
| |
| serializer | back to summary |
|---|---|
| private kotlinx.serialization.KSerializer Tries to find a serializer that can marshall or unmarshall instances of the given type using kotlinx.serialization. If no serializer can be found, an exception is thrown. Resolved serializers are cached and cached results are returned on successive calls.
| |
| toJson | back to summary |
|---|---|
| protected void toJson(Object payload, Type resolvedType, Writer writer) Implements abstract org.
| |
| toJson | back to summary |
|---|---|
| protected String toJson(Object payload, Type resolvedType) Implements abstract org.
| |