@Target({PACKAGE,TYPE})
@Retention(SOURCE)
@Repeatable(GeneratePrisms.class)
public @interface GeneratePrism
Generates a Prism for the specified annotation, in the same package as the target.
If multiple @Prism annotations specifying the same value() (and name()) are present within one package, only one Prism will be generated and no error will be raised.
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionClass<? extends Annotation> The annotation to generate a prism for. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe name of the generated prism class.booleanSet to true for the prism to have public access, otherwise the generated prism and its members will be package visible.Class<?> Set the class the generated Prism class will extend.Class<?>[]Set the interfaces the generated Prism class will implement.
-
Element Details
-
value
Class<? extends Annotation> valueThe annotation to generate a prism for. -
name
String nameThe name of the generated prism class. Defaults to XXPrism where XX is the simple name of the annotation specified by value().- Default:
""
-
publicAccess
boolean publicAccessSet to true for the prism to have public access, otherwise the generated prism and its members will be package visible. The default is sufficient if the prism is generated in the same package as the AnnotationProcessor which uses them.- Default:
false
-
superClass
Class<?> superClassSet the class the generated Prism class will extend. Useful for adding shared functionality for multiple Prisms.- Default:
java.lang.Void.class
-
superInterfaces
Class<?>[] superInterfacesSet the interfaces the generated Prism class will implement. Useful for grouping multiple similar annotations. (e.g. You could have a common interface for Jakarta/Javax versions of an annotation)- Default:
{}
-