title: Validation Library Design Pattern selection
body: <p>I am writing a library which is used for validating some specific objects. 
  I implemented it like strategy pattern.</p>
  
  <p><strong>What is the best pattern for implementing a validation library ?</strong></p>
  
  <p>Some of my code is shown below.</p>
  
  <pre><code>     //INTERFACE
       public interface IValidator {
  
              public  boolean validate(Object o) throws ValidationException;
  
          }
  
  
      //VALIDATOR OBJECT
      public class Validator {
  
          private IValidator validator;
  
          public Validator(IValidator validator)
          {
              this.validator=validator;
          }
  
          public boolean validate(Object o) throws ValidationException
          {
              return this.validator.validate(o);
          }
  
      }
  
      //EMAIL VALIDATOR 
      public class EmailValidator implements IValidator{
  
          @Override
          public boolean validate(Object o) throws ValidationException {
  
      //VALIDATE E MAIL HERE
  
              return false;
          }
  
      }
  
  
  //TEST RUN
  Validator validator = new Validator(new EmailValidator());
  validator.validate("some email");
  </code></pre>