One, albeit heavy-handed, way to approach this type of requirement
isimplemented by the code
athttp://svn.apache.org/viewvc/incubator/bval/sandbox/bval-jsr303-dynamic/.
This ValidationProvider provides a DynamicValidatorContext that canbe
customized using its #constrain(Class, Annotation)
and#constrain(Class, String, Annotation) methods. The mechanism
forhandling Annotation parameters is extensible, so one potential use
ofthis functionality is the removal of existing constraints. This
mightprovide enough surface area to fuel a discussion on this type
offunctionality for a future version of the spec.
Matt
On Mon, Jan 2, 2012 at 1:39 PM, Gunnar Morling
<gunnar.morling(a)googlemail.com> wrote:
Hi experts,
just recently there was a ticket created in the HV tracker [1] which
suggests to provide a way for "overriding" constraints within
inheritance hierarchies, i.e. the constraints defined on a property of
a parent bean are re-defined on the same property on an inherited bean
type (instead of being added up).
The approach suggested in the ticket doesn't work as described there,
as it isn't possible to define a generic array of constraint
annotations. Nevertheless it might be useful to have a means of
disabling the constraints from super types in special cases.
That said, I personally didn't have that requirement yet, but it makes
sense to me that someone might find this useful.
Any thoughts?
--Gunnar
[1]
https://hibernate.onjira.com/browse/HV-548
_______________________________________________
beanvalidation-dev mailing list
beanvalidation-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/beanvalidation-dev