@Retention(RUNTIME)
@Target(TYPE)
public @interface BeanDefinition
This annotation must be used on classes that should be treated as beans.
| Modifier and Type | Optional Element | Description |
|---|---|---|
java.lang.String |
builderScope |
The scope of the builder class.
|
boolean |
cacheHashCode |
Whether to generate code to cache the hash code.
|
java.lang.String |
cloneStyle |
The configuration for generating clone methods.
|
java.lang.String |
constructorScope |
The scope of the generated constructor.
|
java.lang.String |
factoryName |
The name of the factory method.
|
java.lang.String |
hierarchy |
Information about the bean hierarchy.
|
java.lang.String |
metaScope |
The scope of the meta-bean class.
|
java.lang.String |
style |
The style of bean generation.
|
java.lang.String style
By default, this follows 'smart' rules. Set to 'minimal' to generate a minimal amount of code. Set to 'full' to generate the full code. Set to 'light' to generate a light immutable bean using reflection internally.
java.lang.String constructorScope
Only applicable to immutable beans. By default, this follows 'smart' rules, which generate a private constructor when needed by the builder. Set to 'private' to generate a private constructor. Set to 'package' to generate a package-scoped constructor. Set to 'protected' to generate a protected constructor. Set to 'public' to generate a public constructor. Set to 'public@ConstructorProperties' to generate a public constructor.
java.lang.String metaScope
By default, this follows 'smart' rules, which generate a public meta-bean. Set to 'private' to generate a private meta-bean. Set to 'package' to generate a package-scoped meta-bean. Set to 'public' to generate a public meta-bean.
java.lang.String builderScope
By default, this follows 'smart' rules, which generate a public builder for immutable beans and no builder for mutable beans. Set to 'private' to generate a private builder. Set to 'package' to generate a package-scoped builder. Set to 'public' to generate a public builder.
java.lang.String factoryName
By default, this is an empty string and no factory is generated. Set to 'of' to generate a factory method named 'of.
java.lang.String hierarchy
This is needed to add information that cannot be derived. Set to 'immutable' for a subclass of an immutable bean.
java.lang.String cloneStyle
This flag controls generation of the clone method.
The default is 'smart'.
The valid values are:
Copyright © 2007–2018 Joda.org. All rights reserved.