Thanks Gunnar. I'll have a look at it and come back to you.
On Mon, 04 Oct 2010 00:32:27 +0200, Gunnar Morling
<gunnar.morling(a)googlemail.com> wrote:
Hi,
I pushed a first rough draft for the method-level validation to GitHub at
http://github.com/gunnarmorling/hibernate-validator/tree/method-level-pre...
Currently only validateParameter() is implemented, but it shows, where
the
journey could be going. The draft is implemented as outlined in my
previous
mail:
* MethodConstraintViolation extends ConstraintViolation with two
attributes
"method" and "parameterIndex", which are always set
* ConstraintViolation#rootBean and propertyPath are set relative to any
parameter annotated with @Valid, otherwise they are null
The test at
http://github.com/gunnarmorling/hibernate-validator/blob/method-level-pre...
should give you an impression. Validation is triggered by a dynamic
proxy/invocation handler in the test.
I think I'll have a look at the property path stuff next. I'm still not
sure, whether the path API is the right thing to represent parameters.
Using annotations for parameter names is a good idea, but as you said it
should be optional. Method-level validation should not require name
annotations.