I have some requests for enhancement for the next version of Bean Validation. I'm not sure, if this is the correct forum. So please inform me, if I should post this somewhere else.

[list=][* Make validation constraints @Repeatable and mark *.List @Deprecated for better readability and easier parsing][* Add groups to @Valid for better control and better performance][* Add one single annotation like "@ValidationRule" to cover for any business rule and cross field validations. This annotation must be placed on a method. The method returns a set of constraint violations and either has no parameter (to validate 'this') or one single parameter (the root bean to validate). Should have groups and payload.][* Add a class level annotation "@Validator". This annotation accepts a list of classes for its value. This classes are parsed when validating an object of the so annotated class. All methods in the target class will be invoked which are annotated with "@ValidationRule" and which have one single parameter which is the class annotated with "@Validator". Should have groups and payload.][/list]

Yes, that's on the list, though there is a challenge to make this backwards-compatible with JDK 7 (unless we decide to require at least Java 8). The @List annotations are still needed btw. so we cannot deprecate them. @Repeatable is just syntatic sugar: The compiler translates this into byte code using a "container annotation", so from the byte code level its no difference whether @List has been given explicitly or a repeatable annotation has been specified multiple times

Quote:

Add groups to @Valid for better control and better performance

What is your use case for this? Have you seen the feature of group conversion in BV 1.1 (http://beanvalidation.org/1.1/spec/#constraintdeclarationvalidationprocess-groupsequence-groupconversion)? Maybe this does what you are after.

Quote:

Add one single annotation like "@ValidationRule"

Could you give an example for how this would be used? In which way would this be superior to a custom class-level constraint?

Quote:

Add a class level annotation "@Validator". This annotation accepts a list of classes for its value

Could you give an example for this as well? I am not sure I fully understand this proposal.