Class KotlinSerializationBinaryHttpMessageConverter<T extends kotlinx.serialization.BinaryFormat>
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<Object>
org.springframework.http.converter.AbstractSmartHttpMessageConverter<Object>
org.springframework.http.converter.AbstractKotlinSerializationHttpMessageConverter<T>
org.springframework.http.converter.KotlinSerializationBinaryHttpMessageConverter<T>
- Type Parameters:
T- the type ofBinaryFormat
- All Implemented Interfaces:
HttpMessageConverter<Object>, SmartHttpMessageConverter<Object>
- Direct Known Subclasses:
KotlinSerializationCborHttpMessageConverter, KotlinSerializationProtobufHttpMessageConverter
public abstract class KotlinSerializationBinaryHttpMessageConverter<T extends kotlinx.serialization.BinaryFormat>
extends AbstractKotlinSerializationHttpMessageConverter<T>
Abstract base class for
HttpMessageConverter implementations that
defer to Kotlin binary serializers.
As of Spring Framework 7.0, open polymorphism is supported.
- Since:
- 6.0
- Author:
- Andreas Ahlenstorf, Sebastien Deleuze, Juergen Hoeller, Iain Henderson, Arjen Poutsma
-
Field Summary
Fields inherited from class AbstractHttpMessageConverter
logger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedKotlinSerializationBinaryHttpMessageConverter(T format, MediaType... supportedMediaTypes) Construct anKotlinSerializationBinaryHttpMessageConverterwith 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 AbstractKotlinSerializationHttpMessageConverter
canRead, canWrite, getSupportedMediaTypes, read, supports, supportsRepeatableWrites, writeInternalMethods inherited from class AbstractSmartHttpMessageConverter
readInternal, write, writeInternalMethods inherited from class AbstractHttpMessageConverter
addDefaultHeaders, canRead, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, writeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HttpMessageConverter
getSupportedMediaTypesMethods inherited from interface SmartHttpMessageConverter
canRead, canWrite, read, write
-
Constructor Details
-
KotlinSerializationBinaryHttpMessageConverter
-
-
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.BinaryFormat>- 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.BinaryFormat>- Throws:
IOExceptionHttpMessageNotWritableException
-