Class KotlinSerializationJsonEncoder
java.lang.Object
org.springframework.http.codec.KotlinSerializationSupport<T>
org.springframework.http.codec.KotlinSerializationStringEncoder<kotlinx.serialization.json.Json>
org.springframework.http.codec.json.KotlinSerializationJsonEncoder
public class KotlinSerializationJsonEncoder
extends KotlinSerializationStringEncoder<kotlinx.serialization.json.Json>
Encode from an
Object
stream to a byte stream of JSON objects using
kotlinx.serialization.
This encoder can be used to bind @Serializable
Kotlin classes,
open polymorphic serialization
is not supported.
It supports application/json
, application/x-ndjson
and application/*+json
with
various character sets, UTF-8
being the default.
- Since:
- 5.3
- Author:
- Sebastien Deleuze, Iain Henderson
-
Field Summary
Fields inherited from class org.springframework.http.codec.KotlinSerializationStringEncoder
EMPTY_BYTES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<DataBuffer>
encodeNonStream
(Publisher<?> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) Methods inherited from class org.springframework.http.codec.KotlinSerializationStringEncoder
canEncode, encode, encodeStreamingValue, encodeValue, getEncodableMimeTypes, getEncodableMimeTypes, setStreamingMediaTypes
Methods inherited from class org.springframework.http.codec.KotlinSerializationSupport
canSerialize, format, serializer, supportedMimeTypes
-
Constructor Details
-
KotlinSerializationJsonEncoder
public KotlinSerializationJsonEncoder() -
KotlinSerializationJsonEncoder
public KotlinSerializationJsonEncoder(kotlinx.serialization.json.Json json)
-
-
Method Details
-
encodeNonStream
public reactor.core.publisher.Flux<DataBuffer> encodeNonStream(Publisher<?> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) - Overrides:
encodeNonStream
in classKotlinSerializationStringEncoder<kotlinx.serialization.json.Json>
-