Package jakarta.json.bind.annotation
Annotation Type 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.
This annotation is tightly bound to// Example @JsonbTypeInfo(key = "@key") interface Animal {} class Dog implements Animal {} class Cat implements Animal {}
JsonbSubtype
. It is required to useJsonbSubtype
annotations to specify all the possible classes and their aliases.
-
-
Field Summary
Fields Modifier and Type Fields Description static String
DEFAULT_KEY_NAME
Default type information key name.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description String
key
Key used for keeping the type information (alias).JsonbSubtype[]
value
Allowed aliases of the handled type.
-
-
-
Field Detail
-
DEFAULT_KEY_NAME
static final String DEFAULT_KEY_NAME
Default type information key name.
-
-
Element Detail
-
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:
- {}
-
-