@Retention(value=RUNTIME) @Target(value=FIELD) public @interface PropertyDefinition
This annotation must be used on all private instance variables that should be treated as properties.
public abstract String get
The style is a string describing the getter, typically used for code generation.
By default this is 'smart' which will use the source code knowledge to determine
what to generate. This will be a method of the form isXxx()
for boolean
and getXxx()
for all other types.
Supported style stings are:
public abstract String set
The style is a string describing the mutator, typically used for code generation.
By default this is 'smart' which will use the source code knowledge to determine
what to generate. This will be a method of the form setXxx()
for all types unless
the field is final
. If the field is a final Collection
or Map
of a known type then a set method is generated using addAll
or puAll
Standard style stings are:
public abstract String validate
The property value may be validated by specifying this attribute. By default no validation is performed. The code generator places the validation into the set method and ensures that new objects are validated correctly.
Custom validations, are written by writing a static method and referring to it.
For example, public void checkMyValue(Integer val, String propertyName) ...
The method generally has a void
return, throwing an exception if validation fails.
There must be two arguments, the value and the property name. The value may be the
property type or a superclass (like Object). The property name should be a String.
Standard validation stings are:
Copyright © 2007–2013 Joda.org. All rights reserved.