@java.lang.annotation.Retention(RetentionPolicy.CLASS) @java.lang.annotation.Target(ElementType.TYPE) @GroovyASTTransformationClass("org.grails.compiler.beans.GrailsBeansASTTransformation") public @interface GrailsBeans
| Type | Name and Description |
|---|---|
java.lang.String |
autoConfigurationNameThe name of the generated sibling class, for a grails.plugins.Plugin subclass. |
java.lang.Class<?>[] |
moveAnnotationsAdditional annotation types to move from a grails.plugins.Plugin subclass onto its
generated sibling, beyond the ones recognised automatically. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
The name of the generated sibling class, for a grails.plugins.Plugin subclass. The
default derives from the plugin's own name - a *GrailsPlugin class swaps that suffix
for AutoConfiguration, any other name appends it - in the plugin's own package. Set
this when converting an existing public @AutoConfiguration class whose name doesn't
follow that convention and whose class identity must be preserved (e.g. for
exclude = references, before=/after= ordering from other modules, or
tests that import it by name).
A bare identifier renames the class within the plugin's package. Class identity is the
qualified name, though, and a plugin descriptor sits in the package its implementation
classes sit beneath rather than alongside them, so the class being replaced is often in
another package: give the qualified name and the sibling is generated there instead, e.g.
@GrailsBeans(autoConfigurationName = "com.example.web.ExampleAutoConfiguration") on
com.example.ExampleGrailsPlugin. A name containing a dot is taken as written - it is
never resolved relative to the plugin's package. Generating into a package the plugin does
not otherwise own splits that package across two jars, which a modular or native-image
consumer pays for, so name one of the plugin's own.
Additional annotation types to move from a grails.plugins.Plugin subclass onto its
generated sibling, beyond the ones recognised automatically. The automatic set covers the
common Spring configuration annotations (and anything meta-annotated with them), but it is
a closed list - an annotation outside it that Spring reads off the configuration class
(rather than one this DSL happens to know about) would otherwise silently stay on the
plugin class, where Spring never sees it. E.g.
@GrailsBeans(moveAnnotations = [SomeVendorAnnotation]).