SerializersModuleCollector

SerializersModuleCollector can introspect and accumulate content of any SerializersModule via SerializersModule.dumpTo, using a visitor-like pattern: contextual and polymorphic functions are invoked for each registered serializer.

Not stable for inheritance

SerializersModuleCollector interface is not stable for inheritance in 3rd party libraries, as new methods might be added to this interface or contracts of the existing methods can be changed.

interface SerializersModuleCollector

Functions

contextual
Link copied to clipboard
common

Accept a provider, associated with generic kClass for contextual serialization.

abstract fun <T : Any> contextual(kClass: KClass<T>, provider: (typeArgumentsSerializers: List<KSerializer<*>>) -> KSerializer<*>)

Accept a serializer, associated with kClass for contextual serialization.

open fun <T : Any> contextual(kClass: KClass<T>, serializer: KSerializer<T>)
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
polymorphic
Link copied to clipboard
common

Accept a serializer, associated with actualClass for polymorphic serialization.

abstract fun <Base : Any, Sub : Base> polymorphic(baseClass: KClass<Base>, actualClass: KClass<Sub>, actualSerializer: KSerializer<Sub>)
polymorphicDefault
Link copied to clipboard
common

Accept a default serializer provider, associated with the baseClass for polymorphic serialization.

abstract fun <Base : Any> polymorphicDefault(baseClass: KClass<Base>, defaultSerializerProvider: (className: String?) -> DeserializationStrategy<out Base>?)
toString
Link copied to clipboard
common
open override fun toString(): String

Inheritors

SerializersModuleBuilder
Link copied to clipboard
common