Package pro.projo.interfaces.annotation
Annotation Type Options
@Target(PACKAGE) @Retention(RUNTIME) public @interface Options
The
@Options annotation captures various settings that affect the compile-time
code generation triggered by the @Interface and @Enum annotations.
An @Options annotation can be used stand-alone at package level, where it will
affect code generation for the entire package, or as an argument to individual
@Interface or @Enum annotations, where it will define (or override)
the settings for just that annotation.- Author:
- Mirko Raner
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description TernaryaddAnnotationsThe option for adding annotations (such as@Generated).StringfileExtensionThe file extension to be used for generated files.StandardLocationoutputLocationThe output location for generated files with a custom file extension.Class<? extends UnaryOperator<Writer>>postProcessorThe option for specifying a post-processor class.UnmappedskipThe option for skipping generation of methods that use unmapped types.Class<? extends UnaryOperator<Writer>>typeVariableTransformerThe option for specifying a type variable transformer class.
-
Element Details
-
fileExtension
String fileExtensionThe file extension to be used for generated files. Default value is".java".- Returns:
- the file extension
- Default:
- ".java"
-
outputLocation
StandardLocation outputLocationThe output location for generated files with a custom file extension. NOTE: this setting only has an effect whenfileExtension()is set to a non-default value;.javafiles will always be generated in theStandardLocation.SOURCE_OUTPUTlocation (which is also the default value for this option).- Returns:
- the output location
- Default:
- SOURCE_OUTPUT
-
skip
Unmapped skipThe option for skipping generation of methods that use unmapped types. The default value is@Unmapped(false), i.e., no methods are skipped, even if they use unmapped types.- Returns:
- the option for skipping methods using
Unmappedtypes
- Default:
- @pro.projo.interfaces.annotation.Unmapped(false)
-
addAnnotations
Ternary addAnnotationsThe option for adding annotations (such as@Generated). Defaults toTernary.EITHER, which is interpreted astrue. TheTernarytype is used to make it distinguishable if a boolean option is set to a non-default value at the package level, but is set back to the default value at annotation level. Using plainbooleans, this scenario would not be distinguishable.- Returns:
- whether annotations should be added to the generated code
- Default:
- EITHER
-
postProcessor
Class<? extends UnaryOperator<Writer>> postProcessorThe option for specifying a post-processor class.- Returns:
- the post-processor class
- Default:
- pro.projo.interfaces.annotation.postprocessor.IdentityPostProcessor.class
-
typeVariableTransformer
Class<? extends UnaryOperator<Writer>> typeVariableTransformerThe option for specifying a type variable transformer class.- Returns:
- the type variable transformer
- Default:
- pro.projo.interfaces.annotation.postprocessor.IdentityPostProcessor.class
-