org.openxava.annotations
Annotation Type Depends


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

Declares that a property depends on other one(s).

Applies to properties.

OpenXava uses this info in order to know when to recalculate values of a property in the user interface.
Example:

  @Depends("unitPrice")    
  public BigDecimal getUnitPriceInPesetas() {
    if (unitPrice == null) return null;
    return unitPrice.multiply(new BigDecimal("166.386")).setScale(0, BigDecimal.ROUND_HALF_UP);
  }
 
In this case if the unitPrice changes in the user interface, the value of unitPriceInPesetas is recalculated and redisplayed.

Author:
Javier Paniza

Required Element Summary
 java.lang.String value
          Comma separated list of the properties this property depend on.
 

Element Detail

value

public abstract java.lang.String value
Comma separated list of the properties this property depend on.