- 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 -
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass
<?> When importing an Interface or abstract type use this implementation for `fromJson()`.Specify the Json setting to apply to the imported classesSpecify the Subtype information.
-
Element Details
-
value
Class<?>[] valueSpecify types to generate Json Adapters for. -
jsonSettings
Json jsonSettingsSpecify the Json setting to apply to the imported classes- Default:
@io.avaje.jsonb.Json
-
subtypes
Json.SubType[] subtypesSpecify the Subtype information. Can only be used if there is only one abstract type being imported- Default:
{}
-
implementation
Class<?> implementationWhen importing an Interface or abstract type use this implementation for `fromJson()`.- Default:
java.lang.Void.class
-