Class KotlinSerializationStringHttpMessageConverter<T extends kotlinx.serialization.StringFormat>
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<T>
org.springframework.http.converter.AbstractGenericHttpMessageConverter<Object>
org.springframework.http.converter.AbstractKotlinSerializationHttpMessageConverter<T>
org.springframework.http.converter.KotlinSerializationStringHttpMessageConverter<T>
- Type Parameters:
T
- the type ofStringFormat
- All Implemented Interfaces:
GenericHttpMessageConverter<Object>
,HttpMessageConverter<Object>
- Direct Known Subclasses:
KotlinSerializationJsonHttpMessageConverter
public abstract class KotlinSerializationStringHttpMessageConverter<T extends kotlinx.serialization.StringFormat>
extends AbstractKotlinSerializationHttpMessageConverter<T>
Abstract base class for
HttpMessageConverter
implementations that
defer to Kotlin string serializers.- Since:
- 6.0
- Author:
- Andreas Ahlenstorf, Sebastien Deleuze, Juergen Hoeller, Iain Henderson, Arjen Poutsma
-
Field Summary
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
-
Constructor Summary
ModifierConstructorDescriptionprotected
KotlinSerializationStringHttpMessageConverter
(T format, MediaType... supportedMediaTypes) Construct anKotlinSerializationStringHttpMessageConverter
with format and supported media types. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
readInternal
(kotlinx.serialization.KSerializer<Object> serializer, T format, HttpInputMessage inputMessage) Reads the given input message with the given serializer and format.protected 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.Methods inherited from class org.springframework.http.converter.AbstractKotlinSerializationHttpMessageConverter
canRead, canWrite, read, readInternal, supports, writeInternal
Methods inherited from class org.springframework.http.converter.AbstractGenericHttpMessageConverter
write, writeInternal
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
addDefaultHeaders, canRead, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.http.converter.HttpMessageConverter
canRead, canWrite, getSupportedMediaTypes, getSupportedMediaTypes, read, write
-
Constructor Details
-
KotlinSerializationStringHttpMessageConverter
Construct anKotlinSerializationStringHttpMessageConverter
with format and supported media types.
-
-
Method Details
-
readInternal
protected Object readInternal(kotlinx.serialization.KSerializer<Object> serializer, T format, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException Description copied from class:AbstractKotlinSerializationHttpMessageConverter
Reads the given input message with the given serializer and format.- Specified by:
readInternal
in classAbstractKotlinSerializationHttpMessageConverter<T extends kotlinx.serialization.StringFormat>
- Throws:
IOException
HttpMessageNotReadableException
-
writeInternal
protected void writeInternal(Object object, kotlinx.serialization.KSerializer<Object> serializer, T format, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException Description copied from class:AbstractKotlinSerializationHttpMessageConverter
Write the given object to the output message with the given serializer and format.- Specified by:
writeInternal
in classAbstractKotlinSerializationHttpMessageConverter<T extends kotlinx.serialization.StringFormat>
- Throws:
IOException
HttpMessageNotWritableException
-