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

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
     
    Apply a mixin type.
    Specifies a package name where types can be found.
    boolean
     
    Allows making an external class or interface serializable.
  • 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.
      Default:
      void.class
    • packageName

      String packageName
      Specifies a package name where types can be found.

      Only publicly accessible types will be processed. Nested packages will not be processed and have to be defined explicitly.

      Returns:
      The package name where types can be found to import.
      Since:
      2.2.2
      Default:
      ""
    • 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