|
|
|
Section 4.5.5 of Validation Specification V 1.1 allows that "providers may implement alternative, potentially more liberal, approaches for handling constrained methods in inheritance hierarchies". By default, an implementation must throw a {{ ConstraintDefinitionException }} when a parameter constraint is defined on an overriding method. The requested feature would implement a property to allow for relaxation of this requirement in two modes. The first mode would simply relax the requirement entirely, i.e. constraints may be defined on overriding methods without limit. The second mode would allow constraints on overriding methods to re-define existing constraints on the overridden method. For example: {code} public class A { public abstract int m(@NotNull Integer x){...} } {code}
{code} public class B extends A { public int m(@NotNull(groups={GroupOne.class}) {...} } {code} The second mode preserves some indication in code that a constraint violation may occur.
|
|
|
|