Class KotlinSerializationStringHttpMessageConverter<T extends kotlinx.serialization.StringFormat>
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<T>
org.springframework.http.converter.AbstractSmartHttpMessageConverter<Object>
org.springframework.http.converter.AbstractKotlinSerializationHttpMessageConverter<T>
org.springframework.http.converter.KotlinSerializationStringHttpMessageConverter<T>
- Type Parameters:
T- the type ofStringFormat
- All Implemented Interfaces:
HttpMessageConverter<Object>,SmartHttpMessageConverter<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
ConstructorsModifierConstructorDescriptionprotectedKotlinSerializationStringHttpMessageConverter(T format, MediaType... supportedMediaTypes) Construct anKotlinSerializationStringHttpMessageConverterwith format and supported media types. -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectreadInternal(kotlinx.serialization.KSerializer<Object> serializer, T format, HttpInputMessage inputMessage) Reads the given input message with the given serializer and format.protected voidwriteInternal(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, supports, supportsRepeatableWrites, writeInternalMethods inherited from class org.springframework.http.converter.AbstractSmartHttpMessageConverter
readInternal, write, writeInternalMethods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
addDefaultHeaders, canRead, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.http.converter.HttpMessageConverter
getSupportedMediaTypes, getSupportedMediaTypesMethods inherited from interface org.springframework.http.converter.SmartHttpMessageConverter
canRead, canWrite, read, write
-
Constructor Details
-
KotlinSerializationStringHttpMessageConverter
Construct anKotlinSerializationStringHttpMessageConverterwith 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:AbstractKotlinSerializationHttpMessageConverterReads the given input message with the given serializer and format.- Specified by:
readInternalin classAbstractKotlinSerializationHttpMessageConverter<T extends kotlinx.serialization.StringFormat>- Throws:
IOExceptionHttpMessageNotReadableException
-
writeInternal
protected void writeInternal(Object object, kotlinx.serialization.KSerializer<Object> serializer, T format, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException Description copied from class:AbstractKotlinSerializationHttpMessageConverterWrite the given object to the output message with the given serializer and format.- Specified by:
writeInternalin classAbstractKotlinSerializationHttpMessageConverter<T extends kotlinx.serialization.StringFormat>- Throws:
IOExceptionHttpMessageNotWritableException
-