Package org.springframework.http.codec.json

# 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

All Implemented Interfaces:
  `org.springframework.core.codec.Encoder<Object>`

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

Constructors
Constructor
Description
`KotlinSerializationJsonEncoder()`
`KotlinSerializationJsonEncoder(kotlinx.serialization.json.Json json)`

## Method Summary

Modifier and Type
Method
Description
`reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer>`
`encodeNonStream(Publisher<?> inputStream, org.springframework.core.io.buffer.DataBufferFactory bufferFactory, org.springframework.core.ResolvableType elementType, org.springframework.util.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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### KotlinSerializationJsonEncoder

public KotlinSerializationJsonEncoder()

### KotlinSerializationJsonEncoder

public KotlinSerializationJsonEncoder(kotlinx.serialization.json.Json json)

## Method Details

### encodeNonStream

public reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> encodeNonStream(Publisher<?> inputStream, org.springframework.core.io.buffer.DataBufferFactory bufferFactory, org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String,Object> hints)

Overrides:
  `encodeNonStream` in class `KotlinSerializationStringEncoder<kotlinx.serialization.json.Json>`