Interface IValidator

  • All Superinterfaces:
    java.io.Serializable
    All Known Subinterfaces:
    IRemoveValidator
    All Known Implementing Classes:
    ComparatorValidator

    public interface IValidator
    extends java.io.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 Detail

      • validate

        void validate​(Messages errors)
               throws java.lang.Exception
        Does validation.

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