Annotation Interface Json.Polymorphic

Enclosing class:
Json

@Retention(CLASS) @Target(TYPE) public static @interface Json.Polymorphic
Polymorphism supporting annotation. This annotation defines the default implementation of the as its value(). It is also possible to configure the JSON key name to be used for alias. See key().
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Key used for keeping the alias information.
    The default implementation/extending class to be used when alias is not provided.
  • Element Details

    • key

      String key
      Key used for keeping the alias information. This key is used as a JSON property name. Default value is @type.
      Returns:
      JSON property name
      Default:
      "@type"
    • value

      Class<?> value
      The default implementation/extending class to be used when alias is not provided. The default value Object is intended as a "not specified" marker. In that case, no default implementation/extending class will be used and an exception will be thrown instead.
      Returns:
      the default implementation/extending class of the annotated type.
      Default:
      java.lang.Object.class