The recommended way of dealing with this is to have an inner
List definition in your constraint:
Code:
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = {})
public @interface XLowerThanY {
...
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@Documented
@interface List {
XLowerThanY[] value();
}
}
In this scenario you can then use @XLowerThanY.List({...}) to specify multiple
XLowerThanY constraints.
--Hardy