Java 8 allows annotations to be marked as repeatable, meaning they can be specified several times on the same element:
{code} @Length(min = 5, message = "The field must be at least 5 characters"), @Length(max = 50, message = "The field must be less than 50 characters") private String myString; {code}
In contrast, Java 7 and before required to make use of the provided {{@List}} annotation.
|