org.joda.beans
Annotation Type BeanDefinition


@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface BeanDefinition

Annotation defining a bean for code generation.

This annotation must be used on classes that should be treated as beans.


Optional Element Summary
 String builderScope
          The scope of the builder class.
 boolean cacheHashCode
          Whether to generate code to cache the hash code.
 String constructorScope
          The scope of the generated constructor.
 String hierarchy
          Information about the bean hierarchy.
 String style
          The style of bean generation.
 

style

public abstract String style
The style of bean generation.

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.

Default:
"smart"

constructorScope

public abstract String constructorScope
The scope of the generated constructor.

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.

Default:
"smart"

builderScope

public abstract String builderScope
The scope of the builder class.

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.

Default:
"smart"

hierarchy

public abstract String hierarchy
Information about the bean hierarchy.

This is needed to add information that cannot be derived. Set to 'immutable' for a subclass of an immutable bean.

Default:
""

cacheHashCode

public abstract boolean cacheHashCode
Whether to generate code to cache the hash code.

Setting this to true will cause the hash code to be cached using the racy single check idiom. The setting only applies to immutable beans.

Default:
false


Copyright © 2007–2015 Joda.org. All rights reserved.