public interface IValidator
extends java.io.Serializable
The method of this interfaces does not receive the value to validate, this must to be assigned as property. For example, you can use a validator in the next way:
IValidator v = new LimitValidator(); v.setLimit(1000); v.setValue(invoice.getAmount()); // For example Messages errors = new Messages(); v.validate(errors); // If there are validation errors are added to 'errors'.
Modifier and Type | Method and Description |
---|---|
void |
validate(Messages errors)
Does validation.
|
void validate(Messages errors) throws java.lang.Exception
errors
- Validation errors list; a list of id to read in
the resources filejava.lang.Exception
- Any unexpected problem