SerialFormat
HttpMessageConverter implementations that
use Kotlin serialization.
| Modifier and Type | Field and Description |
|---|---|
| private final T | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| protected | AbstractKotlinSerializationHttpMessageConverter(T
the format format, MediaType... the supported media types supportedMediaTypes)Construct an |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | canRead(Type
the (potentially generic) type to test for readability type, Class<?> a context class for the target type, for example a class
in which the target type appears in a method signature (can be contextClass, MediaType null)the media type to read, can be mediaType)null if not specified.
Typically, the value of a Content-Type header.Overrides org. Implements org. |
| public boolean | canWrite(Type
the (potentially generic) type to test for writability
(can be type, Class<?> null if not specified)the source object class to test for writability clazz, MediaType the media type to write (can be mediaType)null if not specified);
typically the value of an Accept header.Overrides org. Implements org. |
| private boolean | hasPolymorphism(kotlinx.
|
| public final Object | read(Type
the (potentially generic) type of object to return. This type must have
previously been passed to the type, Class<?> canRead method of this interface,
which must have returned true.a context class for the target type, for example a class
in which the target type appears in a method signature (can be contextClass, HttpInputMessage null)the HTTP input message to read from inputMessage)Implements org. |
| protected final Object | readInternal(Class<?>
the type of object to return clazz, HttpInputMessage the HTTP input message to read from inputMessage)Implements abstract org. |
| protected abstract Object | readInternal(kotlinx.serialization.KSerializer<Object> serializer, T format, HttpInputMessage inputMessage)
Reads the given input message with the given serializer and format. |
| private kotlinx.serialization.KSerializer | Returns: a resolved serializer for the given type, ornullthe 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 boolean | supports(Class<?>
the class to test for support clazz)Overrides org. |
| protected boolean | supportsRepeatableWrites(Object
the object t object)Overrides org. |
| protected final void | writeInternal(Object
the object to write to the output message object, Type the type of object to write (may be type, HttpOutputMessage null)the HTTP output message to write to outputMessage)Implements abstract org. |
| protected abstract void | writeInternal(Object object, kotlinx.serialization.KSerializer<Object> serializer, T format, HttpOutputMessage outputMessage)
Write the given object to the output message with the given serializer and format. |
| format | back to summary |
|---|---|
| private final T format | |
| serializerCache | back to summary |
|---|---|
| private final Map<Type, kotlinx.serialization.KSerializer<Object>> serializerCache | |
| AbstractKotlinSerializationHttpMessageConverter | back to summary |
|---|---|
| protected AbstractKotlinSerializationHttpMessageConverter(T format, MediaType... supportedMediaTypes) Construct an
| |
| canRead | back to summary |
|---|---|
| public boolean canRead(Type type, Class<?> contextClass, MediaType mediaType) Overrides org. Implements org. Doc from org. Indicates whether the given type can be read by this converter.
This method should perform the same checks as
| |
| canWrite | back to summary |
|---|---|
| public boolean canWrite(Type type, Class<?> clazz, MediaType mediaType) Overrides org. Implements org. Doc from org. Indicates whether the given class can be written by this converter. This method should perform the same checks as
| |
| hasPolymorphism | back to summary |
|---|---|
| private boolean hasPolymorphism(kotlinx. | |
| read | back to summary |
|---|---|
| public final Object read(Type type, Class<?> contextClass, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException Implements org. Doc from org. Read an object of the given type form the given input message, and returns it.
| |
| readInternal | back to summary |
|---|---|
| protected final Object readInternal(Class<?> clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException Implements abstract org. Doc from org. Abstract template method that reads the actual object. Invoked from
| |
| readInternal | back to summary |
|---|---|
| protected abstract Object readInternal(kotlinx.serialization.KSerializer<Object> serializer, T format, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException Reads the given input message with the given serializer and format. | |
| 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, Resolved serializers are cached and cached results are returned on successive calls. | |
| supports | back to summary |
|---|---|
| protected boolean supports(Class<?> clazz) Overrides org. Doc from org. Indicates whether the given class is supported by this converter. | |
| supportsRepeatableWrites | back to summary |
|---|---|
| protected boolean supportsRepeatableWrites(Object object) Overrides org. Doc from org. Indicates whether this message converter can write the given object multiple times. Default implementation returns | |
| writeInternal | back to summary |
|---|---|
| protected final void writeInternal(Object object, Type type, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException Implements abstract org. Doc from org. Abstract template method that writes the actual body. Invoked from
| |
| writeInternal | back to summary |
|---|---|
| protected abstract void writeInternal(Object object, kotlinx.serialization.KSerializer<Object> serializer, T format, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException Write the given object to the output message with the given serializer and format. | |