Annotation Type Json.Import

Enclosing class:
Json

@Retention(CLASS) @Repeatable(List.class) @Target({TYPE,PACKAGE,MODULE}) public static @interface Json.Import
Specify types to generate JsonAdapters for.

These types are typically in an external project / dependency or otherwise types that we can't or don't want to explicitly annotate with @Json.

Typically, we put this annotation on a package.


 @Json.Import({Customer.class, Product.class, ...})
 package org.example.processor;

 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
     
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Class<?>[]
    Specify types to generate Json Adapters for.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    When importing an Interface or abstract type use this implementation for `fromJson()`.
    Specify the Json setting to apply to the imported classes
    Specify the Subtype information.
  • Element Details

    • value

      Class<?>[] value
      Specify types to generate Json Adapters for.
    • jsonSettings

      Json jsonSettings
      Specify the Json setting to apply to the imported classes
      Default:
      @io.avaje.jsonb.Json
    • subtypes

      Json.SubType[] subtypes
      Specify the Subtype information. Can only be used if there is only one abstract type being imported
      Default:
      {}
    • implementation

      Class<?> implementation
      When importing an Interface or abstract type use this implementation for `fromJson()`.
      Default:
      java.lang.Void.class