public class KotlinxSerializer implements JsonSerializer
A interface JsonSerializer implemented for kotlinx Serializable classes. Since serializers are determined statically, you
must set the mapping for each Serializable class to it's KSerializer manually, using KotlinxSerializer.setMapper or register.
KotlinxSerializer().apply {
register
| Modifier and Type | Class and Description |
|---|---|
static class |
KotlinxSerializer.Companion |
| Modifier and Type | Field and Description |
|---|---|
static KotlinxSerializer.Companion |
Companion |
| Constructor and Description |
|---|
KotlinxSerializer(kotlinx.serialization.json.Json json)
A
interface JsonSerializer implemented for kotlinx Serializable classes. Since serializers are determined statically, you
must set the mapping for each Serializable class to it's KSerializer manually, using KotlinxSerializer.setMapper or register. |
KotlinxSerializer()
A
interface JsonSerializer implemented for kotlinx Serializable classes. Since serializers are determined statically, you
must set the mapping for each Serializable class to it's KSerializer manually, using KotlinxSerializer.setMapper or register. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
read(io.ktor.client.call.TypeInfo type,
io.ktor.client.response.HttpResponse response,
kotlin.coroutines.experimental.Continuation<java.lang.Object> p)
Read content from response using information specified in type.
|
<T> void |
setListMapper(kotlin.reflect.KClass<T> type,
kotlinx.serialization.KSerializer<T> serializer)
Set mapping from type to generated KSerializer.
|
<T> void |
setMapper(kotlin.reflect.KClass<T> type,
kotlinx.serialization.KSerializer<T> serializer)
Set mapping from type to generated KSerializer.
|
io.ktor.http.content.OutgoingContent |
write(java.lang.Object data)
Convert data object to OutgoingContent.
|
read, writepublic static KotlinxSerializer.Companion Companion
public KotlinxSerializer(kotlinx.serialization.json.Json json)
A interface JsonSerializer implemented for kotlinx Serializable classes. Since serializers are determined statically, you
must set the mapping for each Serializable class to it's KSerializer manually, using KotlinxSerializer.setMapper or register.
KotlinxSerializer().apply {
register
public KotlinxSerializer()
A interface JsonSerializer implemented for kotlinx Serializable classes. Since serializers are determined statically, you
must set the mapping for each Serializable class to it's KSerializer manually, using KotlinxSerializer.setMapper or register.
KotlinxSerializer().apply {
register
public <T> void setMapper(kotlin.reflect.KClass<T> type,
kotlinx.serialization.KSerializer<T> serializer)
Set mapping from type to generated KSerializer.
public <T> void setListMapper(kotlin.reflect.KClass<T> type,
kotlinx.serialization.KSerializer<T> serializer)
Set mapping from type to generated KSerializer.
public io.ktor.http.content.OutgoingContent write(java.lang.Object data)
Convert data object to OutgoingContent.
public java.lang.Object read(io.ktor.client.call.TypeInfo type,
io.ktor.client.response.HttpResponse response,
kotlin.coroutines.experimental.Continuation<java.lang.Object> p)
Read content from response using information specified in type.