Annotation Interface JsonbTypeInfo


@JsonbAnnotation @Retention(RUNTIME) @Target({ANNOTATION_TYPE,TYPE}) public @interface JsonbTypeInfo
Configuration annotation of the type information handling.
This annotation is required on the most common parent of all classes when type information will be applied.

 // Example
 @JsonbTypeInfo(key = "@key")
 interface Animal {}

 class Dog implements Animal {}
 class Cat implements Animal {}
 
This annotation is tightly bound to JsonbSubtype. It is required to use JsonbSubtype annotations to specify all the possible classes and their aliases.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Key used for keeping the type information (alias).
    Allowed aliases of the handled type.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default type information key name.
  • Field Details

  • Element Details

    • key

      String key
      Key used for keeping the type information (alias). Default value is @type.
      Returns:
      key name
      Default:
      "@type"
    • value

      JsonbSubtype[] value
      Allowed aliases of the handled type.
      Returns:
      list of allowed aliases
      Default:
      {}