org.openxava.annotations
Annotation Type PropertyValue


@Retention(value=RUNTIME)
@Target(value={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:

Author:
Javier Paniza

Required Element Summary
 java.lang.String name
          The name of the property to fill.
 
Optional Element Summary
 java.lang.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.
 java.lang.String value
          Fix value to fill the property of the target calculator, validator, etc.
 

Element Detail

name

public abstract java.lang.String name
The name of the property to fill.

from

public abstract java.lang.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

public abstract java.lang.String value
Fix value to fill the property of the target calculator, validator, etc.

'value' is exclusive with 'from'

Default:
""