title: Custom bean validation by an abstract class or interface
body: <p>Let's consider the following example, I'm creating a custom bean validation constraint by means of a new annotation type:</p>
  
  <pre><code>@Target( { METHOD, FIELD, ANNOTATION_TYPE })
  @Retention(RUNTIME)
  @Constraint(validatedBy = MyAbstractOrInterfaceValidator.class)
  @Documented
  public @interface MyAnnotation {
  
      String message() default "{}";
  
      Class&lt;?&gt;[] groups() default {};
  
      Class&lt;? extends Payload&gt;[] payload() default {};
  
      SomeClass value();
  
  }
  </code></pre>
  
  <p>My question is: can <code>MyBastractOrInterfaceValidator</code> class be an abstract class or an interface? How can I control which implementation of that interface or abstract class is used to validate an element the annotation is placed on?</p>