title: Hibernate Validator - Add a Dynamic ConstraintValidator
body: <p>After learning about <a href="https://docs.jboss.org/hibernate/validator/4.0.1/reference/en/html/validator-customconstraints.html" rel="noreferrer">Hibernate Custom Validators</a>, it has given me an interest in one topic, could I possibly create one base annotation wherein I could set which Validator to use?</p>
  
  <pre><code>@Target({ ElementType.FIELD })
  @Retention(RetentionPolicy.RUNTIME)
  @Constraint(validatedBy = validator().class)
  public @interface CustomAnnotation {
      public String message();
      Class&lt;?&gt;[] groups() default {};
      Class&lt;? extends Payload&gt;[] payload() default {};
      Class&lt;? extends ConstraintValidator&lt;? extends CustomAnnotation, Serializable&gt;&gt; validator();
  }
  </code></pre>
  
  <p>So that I could use <code>@CustomAnnotation</code> in this manner</p>
  
  <pre><code>@CustomAnnotation(validator = CustomConstraintValidator.class, message = "validationMessage")
  private Object fieldName;
  </code></pre>