Annotation Type DefaultSerializer


  • @Retention(RUNTIME)
    @Target(TYPE)
    public @interface DefaultSerializer
    Sets the default serializer to use for the annotated class. The specified Serializer class must have a constructor taking a Kryo instance and a class, a Kryo instance, a class, or no arguments.
    Author:
    Nathan Sweet
    See Also:
    Kryo.register(Class)
    • Element Detail

      • value

        Class<? extends Serializer> value
        The serializer class to serialize the annotated type, which will be created by the serializerFactory(). Can be omitted if the serializer factory knows what type of serializer to create.
        Default:
        com.esotericsoftware.kryo.Serializer.class
      • serializerFactory

        Class<? extends SerializerFactory> serializerFactory
        The factory used to create the serializer.
        Default:
        com.esotericsoftware.kryo.SerializerFactory.ReflectionSerializerFactory.class