Package org.openxava.annotations
Annotation Type PropertyValue
-
@Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface PropertyValueEncapsulate 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 java.lang.StringnameThe name of the property to fill.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.StringfromThe 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.StringvalueFix value to fill the property of the target calculator, validator, etc.
-