title: Is it possible to set multiple messages using oval AbstractAnnotationCheck?
body: <p>I am using the Oval validation framework to validate fields that HTML fields cannot hold malicious javascript code.  For the malicious code detection, I am using an external framework that returns me a list of errors that I would like to use as error messages on the field.  The problem I am running into is that I can only setMessage in the check implementation, while I would rather do something like setMessages(List).  So while I am currently just joining the errors with a comma, I would rather pass them back up as a list.</p>
  
  <h3>Annotation</h3>
  
  <pre><code>@Target({ ElementType.METHOD, ElementType.FIELD})
  @Retention( RetentionPolicy.RUNTIME)
  @Constraint(checkWith = HtmlFieldValidator.class)
  public @interface HtmlField {
     String message() default "HTML could not be validated";
  }
  </code></pre>
  
  <h3>Check</h3>
  
  <pre><code>public class HtmlFieldValidator  extends AbstractAnnotationCheck&lt;HtmlDefaultValue&gt; {
      public boolean isSatisfied( Object o, Object o1, OValContext oValContext, Validator validator ) throws OValException {
          if (o1 == null) {
              return true;
          } else {
              CleanResults cleanResults = UIowaAntiSamy.cleanHtml((String) o1);
              if (cleanResults.getErrorMessages().size() &gt; 0) {
                  String errors = StringUtils.join(cleanResults.getErrorMessages(), ", ");
                  this.setMessage(errors);
                  return false;
              } else {
                  return true;
              }
          }
      }
  }
  </code></pre>
  
  <h3>Model class</h3>
  
  <pre><code>class Foo {
  
      @HtmlField
      public String bar;
  
  }
  </code></pre>
  
  <h3>Controller code</h3>
  
  <pre><code>Validator validator = new Validator(); // use the OVal validator
  Foo foo = new Foo();
  foo.bar = "&lt;script&gt;hack()&lt;/script&gt;";
  
  List&lt;ConstraintViolation&gt; violations = validator.validate(bo);
  
  if (violations.size() &gt; 0) {
      // inform the user that I cannot accept the string because 
      // it contains invalid html, using error messages from OVal
  }
  </code></pre>