Package org.openxava.annotations
Annotation 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 -
Optional Element Summary
Optional Elements
-
Element Details
-
name
String nameThe name of the property to fill.
-
-
-
from
String fromThe 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 valueFix value to fill the property of the target calculator, validator, etc.'value' is exclusive with 'from'
- Default:
- ""
-