Annotation Interface Calculation


@Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface Calculation
Expression to do the calculation for a property.

Applies to properties.

The expression can contain +, -, *, (), numeric values and properties names of the same entity. For example:

 @Calculation("((hours * worker.hourPrice) + tripCost - discount) * vatPercentage / 100") 
 private BigDecimal total;
You can note as worker.hourPrice can be used to get value from references.

The calculation is executed and displayed when the user changes any value of the properties used in the expression in the UI, however the value is not saved until the user clicks on save button.

Since:
5.7
Author:
Javier Paniza
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Expression with +, -, *, (), numeric values and other properties names of the same entity.
  • Element Details

    • value

      String value
      Expression with +, -, *, (), numeric values and other properties names of the same entity.