PolymorphicModuleBuilder
A builder which registers all its content for polymorphic serialization in the scope of the base class. If baseSerializer is present, registers it as a serializer for baseClass (which will be used if base class is serializable). Subclasses and its serializers can be added with subclass builder function.
To obtain an instance of this builder, use SerializersModuleBuilder.polymorphic DSL function.
Functions
Adds a default serializers provider associated with the given baseClass to the resulting module. defaultDeserializerProvider is invoked when no polymorphic serializers associated with the className
were found. className
could be null
for formats that support nullable class discriminators (currently only Json
with JsonBuilder.useArrayPolymorphism
set to false
)
Registers a subclass in the resulting module under the base class.
Registers a serializer for class T in the resulting module under the base class.
Registers a subclass in the resulting module under the base class.