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)
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.Class<? extends SerializerFactory> serializerFactory
      The factory used to create the serializer.
      java.lang.Class<? extends Serializer> value
      The serializer class to serialize the annotated type, which will be created by the serializerFactory().
    • Element Detail

      • value

        java.lang.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

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