Annotation Interface PropertyValue


@Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface PropertyValue
Encapsulate the value for inject it in a property.

It's used to fill the values of a validator, calculator, etc before execute it.

Example:

  @EntityValidator(validator=CheapProductValidator.class, properties= {
    @PropertyValue(name="limit", value="100"),
    @PropertyValue(name="description"),
    @PropertyValue(name="price", from="unitPrice")
  })
  public class Product {
  ...
 
For example, in this case before executing the validation of CheapProductValidator OpenXava does:
  • Put "100" in the property "limit" of CheapProductValidator.
  • Moves the value of 'description' of the current product to 'description' of CheapProductValidator.
  • Moves the value of 'unitPrice' of the current product to 'price' of CheapProductValidator.
Author:
Javier Paniza
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the property to fill.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The property name of the the current object from when we obtain the data to fill the property of the target calculator, validator, etc.
    Fix value to fill the property of the target calculator, validator, etc.
  • Element Details

    • name

      String name
      The name of the property to fill.

    • from

      String from
      The property name of the the current object from when we obtain the data to fill the property of the target calculator, validator, etc. By default, name() is assumed.
      'from' is exclusive with 'value'
      Default:
      ""
    • value

      String value
      Fix value to fill the property of the target calculator, validator, etc.

      'value' is exclusive with 'from'

      Default:
      ""