title: Validate elements of a String array with Java Bean Validation
body: <p>I have a simple class that has one of its properties as a String array. As per <a href="http://beanvalidation.org/1.1/spec/#constraintdeclarationvalidationprocess-validationroutine" rel="noreferrer">this</a> document, using @Valid on an array, collection etc. will recursively validate each element of the array/collection.</p>
  
  <pre><code>@Valid
  @Pattern(regexp="^[_ A-Za-z0-9]+$")
  public String[] defaultAppAdminRoles;
  </code></pre>
  
  <p>the above annotation on the property generates the following exception:</p>
  
  <pre><code>Exception in thread "main" javax.validation.UnexpectedTypeException: No validator could be found for type java.lang.String[]. See: @Pattern at public java.lang.String[] com.hm.vigil.platform.ops.model.Application.defaultAppAdminRoles
  at org.apache.bval.jsr303.AnnotationProcessor.checkOneType(AnnotationProcessor.java:326)
  at org.apache.bval.jsr303.AnnotationProcessor.getConstraintValidator(AnnotationProcessor.java:301)
  at org.apache.bval.jsr303.AnnotationProcessor.applyConstraint(AnnotationProcessor.java:241)
  at org.apache.bval.jsr303.AnnotationProcessor.processAnnotation(AnnotationProcessor.java:149)
  at org.apache.bval.jsr303.AnnotationProcessor.processAnnotations(AnnotationProcessor.java:90)
  at org.apache.bval.jsr303.Jsr303MetaBeanFactory.processClass(Jsr303MetaBeanFactory.java:134)
  at org.apache.bval.jsr303.Jsr303MetaBeanFactory.buildMetaBean(Jsr303MetaBeanFactory.java:95)
  at org.apache.bval.MetaBeanBuilder.buildForClass(MetaBeanBuilder.java:131)
  at org.apache.bval.MetaBeanManager.findForClass(MetaBeanManager.java:102)
  at org.apache.bval.jsr303.ClassValidator.validate(ClassValidator.java:140)
  at com.hm.vigil.platform.commons.AbstractValidatable.isValid(AbstractValidatable.java:33)
  at com.hm.vigil.platform.ops.model.Application.main(Application.java:54)
  </code></pre>
  
  <p>I am using Apache BVal as validation provider.</p>
  
  <p>The question, is the above method correct? </p>
  
  <p>If it is not correct, what is the correct way to validate an array/collection with bean validation?</p>
  
  <p>If it is correct, then is it some limitation of Apache BVal? </p>