Package com.esotericsoftware.kryo
Interface SerializerFactory
-
- All Known Implementing Classes:
SerializerFactory.FieldSerializerFactory,SerializerFactory.ReflectionSerializerFactory,SerializerFactory.SingletonSerializerFactory,SerializerFactory.TaggedFieldSerializerFactory
public interface SerializerFactoryA serializer factory that allows the creation of serializers. This factory will be called when aKryoserializer discovers a new type for which no serializer is yet known. For example, when a factory is registered viaKryo.setDefaultSerializer(SerializerFactory)a different serializer can be created dependent on the type of a class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSerializerFactory.FieldSerializerFactoryA serializer factory that returns new, configuredFieldSerializerinstances.static classSerializerFactory.ReflectionSerializerFactoryThis factory instantiates new serializers of a given class via reflection.static classSerializerFactory.SingletonSerializerFactoryA serializer factory that always returns a given serializer instance rather than creating new serializer instances.static classSerializerFactory.TaggedFieldSerializerFactoryA serializer factory that returns new, configuredTaggedFieldSerializerinstances.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SerializernewSerializer(Kryo kryo, java.lang.Class<?> type)Creates a new serializer
-
-
-
Method Detail
-
newSerializer
Serializer newSerializer(Kryo kryo, java.lang.Class<?> type)
Creates a new serializer- Parameters:
kryo- The serializer instance requesting the new serializer.type- The type of the object that is to be serialized.- Returns:
- An implementation of a serializer that is able to serialize an object of type
type.
-
-