Annotation Interface JsonSubTypes
@Target({ANNOTATION_TYPE,TYPE,FIELD,METHOD,PARAMETER})
@Retention(RUNTIME)
public @interface JsonSubTypes
Annotation used with
JsonTypeInfo
to indicate sub-types of serializable
polymorphic types, and to associate logical names used within JSON content
(which is more portable than using physical Java class names).
Note that just annotating a property or base type with this annotation does
NOT enable polymorphic type handling: in addition, JsonTypeInfo
or equivalent (such as enabling of so-called "default typing") annotation
is needed, and only in such case is subtype information used.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic @interface
Definition of a subtype, along with optional name(s). -
Required Element Summary
Modifier and TypeRequired ElementDescriptionSubtypes of the annotated type (annotated class, or property value type associated with the annotated method).
-
Element Details
-
value
JsonSubTypes.Type[] valueSubtypes of the annotated type (annotated class, or property value type associated with the annotated method). These will be checked recursively so that types can be defined by only including direct subtypes.
-