Interface IValidator

All Superinterfaces:
Serializable
All Known Subinterfaces:
IRemoveValidator
All Known Implementing Classes:
ComparatorValidator

public interface IValidator extends Serializable
Validator.

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'. 
 
Author:
Javier Paniza
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Does validation.
  • Method Details

    • validate

      void validate(Messages errors) throws Exception
      Does validation.

      Parameters:
      errors - Validation errors list; a list of id to read in the resources file
      Throws:
      Exception - Any unexpected problem