[bv-dev] Distinguishing cross-parameter and generic constraints

Gunnar Morling gunnar at hibernate.org
Tue Jan 22 06:05:29 EST 2013


2013/1/21 Emmanuel Bernard <emmanuel at hibernate.org>

> My concern around the latest option is that it forces us to be a
> subclass of ConstraintViolation for the foreseeable future including
> when we reopen the type-safe options we explored in
> http://beanvalidation.org/proposals/BVAL-232/
>

If we want to include a type-safe approach later on, we might do it like
this:

* Pull ConstraintValidator#initialize() up into a new interface
Initializeable
* Change @CrossParameterConstraint#validatedBy() to return Class<?
extendsInitializable<?, ?>>. AFAICS that shouldn't be a problem for
existing
constraint definitions, BV providers need of course to adapt. Short tests I
did looked good.

--Gunnar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20130122/ce30a3ec/attachment.html 


More information about the beanvalidation-dev mailing list