[bv-dev] Value extraction open issue #2: per constraint ConstraintsApplyTo?
gunnar at hibernate.org
Fri Jan 13 07:01:55 EST 2017
Unfortunately, validationAppliesTo() is already taken:
It's used to distinguish between return value and cross-parameter constraints.
Any other name I can think of right now would make up for much
confusion with that option.
2017-01-13 12:22 GMT+01:00 Guillaume Smet <guillaume.smet at gmail.com>:
> Hi again,
> On Fri, Jan 13, 2017 at 12:12 PM, Guillaume Smet <guillaume.smet at gmail.com>
>> The drawback I can see is that it adds a new reserved method to the
>> @Constraint annotations. To make the migration more smooth, we could make it
>> optional and test the returnType of the method before using the result.
> After speaking with Gunnar, we would need a "valid" prefix on the name of
> the method so something like validationAppliesTo would work:
> @Size(3, validationAppliesTo = ANNOTATED_ELEMENT)
> @Size(10, validationAppliesTo = WRAPPED_VALUE)
> ListOfStrings nicknames;
> beanvalidation-dev mailing list
> beanvalidation-dev at lists.jboss.org
More information about the beanvalidation-dev