title: Java Constraint Annotations: Passing Parameter Value To Composite Constraint
body: <p>I'm trying to create my own composite validation annotation to validate a String - so far it is made up of the annotations @NotNull, @NotBlank and @Size</p>
  
  <p>However, I do not want to leave these at default values and want to be able to pass in a parameter value, for example if I do @ValidString (min = 1, max = 50), then the @Size annotation can read these values - is this possible?</p>
  
  <p>My constraint -</p>
  
  <pre><code>@NotNull()
  @NotBlank()
  @Size()
  @Constraint(validatedBy = ValidStringValidator.class)
  @Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
  @Retention(RUNTIME)
  public @interface ValidString {
      String message();
      Class&lt;?&gt;[] groups() default {};
      Class&lt;? extends Payload&gt;[] payload() default {};
      int min() default 1;
      int max() default 255;
  }
  </code></pre>