org.openxava.annotations
Annotation Type DefaultValueCalculator


@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface DefaultValueCalculator

For calculating its initial value.

Applies to properties and references.

With @DefaultValueCalculator you can associate logic to a property or reference. This calculator is for calculating its initial value.
For example:

  @DefaultValueCalculator(CurrentYearCalculator.class)
  private int year;
 
In this case when the user tries to create a new Invoice (for example) he will find that the year field already has a value, that he can change if he wants to do.

Author:
Javier Paniza

Required Element Summary
 java.lang.Class value
          Class with the logic for calculating the initial value, must implements ICalculator.
 
Optional Element Summary
 PropertyValue[] properties
          Inject values to the properties of the calculator before calculating.
 

Element Detail

value

public abstract java.lang.Class value
Class with the logic for calculating the initial value, must implements ICalculator.

properties

public abstract PropertyValue[] properties
Inject values to the properties of the calculator before calculating.

Default:
{}