public class KotlinSerializationJsonDecoder extends org.springframework.core.codec.AbstractDecoder<Object>
This decoder can be used to bind @Serializable
Kotlin classes,
open polymorphic serialization
is not supported.
It supports application/json
and application/*+json
with
various character sets, UTF-8
being the default.
Decoding streams is not supported yet, see kotlinx.serialization/issues/1073 related issue.
Constructor and Description |
---|
KotlinSerializationJsonDecoder() |
KotlinSerializationJsonDecoder(kotlinx.serialization.json.Json json) |
Modifier and Type | Method and Description |
---|---|
boolean |
canDecode(org.springframework.core.ResolvableType elementType,
org.springframework.util.MimeType mimeType) |
reactor.core.publisher.Flux<Object> |
decode(Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream,
org.springframework.core.ResolvableType elementType,
org.springframework.util.MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Mono<Object> |
decodeToMono(Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream,
org.springframework.core.ResolvableType elementType,
org.springframework.util.MimeType mimeType,
Map<String,Object> hints) |
int |
getMaxInMemorySize()
Return the
configured byte count limit. |
void |
setMaxInMemorySize(int byteCount)
Configure a limit on the number of bytes that can be buffered whenever
the input stream needs to be aggregated.
|
getDecodableMimeTypes, getLogger, setLogger
public KotlinSerializationJsonDecoder()
public KotlinSerializationJsonDecoder(kotlinx.serialization.json.Json json)
public void setMaxInMemorySize(int byteCount)
DataBuffer
,
ByteBuffer
, byte[]
,
Resource
, String
, etc.
It can also occur when splitting the input stream, e.g. delimited text,
in which case the limit applies to data buffered between delimiters.
By default this is set to 256K.
byteCount
- the max number of bytes to buffer, or -1 for unlimitedpublic int getMaxInMemorySize()
configured
byte count limit.public boolean canDecode(org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType)
public reactor.core.publisher.Flux<Object> decode(Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream, org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String,Object> hints)