Annotation Interface SerdeImport


@Internal @Target(TYPE) @Retention(RUNTIME) @Repeatable(Repeated.class) public @interface SerdeImport
Annotation to allow external classes to be enabled for serialization / deserialization.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Repeated wrapper for this annotation.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Allows making an external class or interface serializable.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
     
    Apply a mixin type.
    boolean
     
  • Element Details

    • value

      Class<?> value
      Allows making an external class or interface serializable.

      Note that mixins only work with publicly accessible members (constructors, getters/setters etc.), anything not public will not be includes in the serialization/deserialization result.

      Returns:
      The type to enable serialization for.
    • mixin

      Class<?> mixin
      Apply a mixin type. This is equivalent to Jackson objectMapper.addMixInAnnotations(..) allowing to mixin the annotations to the imported type.

      Any fields or methods that match fields or methods declared in the type specified to value() will have the annotations applied to the imported type.

      Returns:
      The mixin type
      Default:
      void.class
    • serializable

      boolean serializable
      Returns:
      Whether to import for serialization. Defaults to true.
      Default:
      true
    • deserializable

      boolean deserializable
      Returns:
      Whether to import for deserialization. Defaults to true.
      Default:
      true