We're updating the issue view to help you get more done. 

Derive constraint target automatically for XML-configured constraints

Description

If a constraint which has a generic and a cross-parameter validator is applied to a method with return value and parameters, its target must be specified using the element validationAppliesTo.

For XML-configured constraints the target could be derived automatically, since the constraint is unambigiously specified either within the return-value or cross-parameter elements. Currently one has to specify a constraint like so in this case:

1 2 3 4 5 6 7 8 9 <method name="findCustomer"> <parameter type="java.lang.String"/> <parameter type="java.lang.String"/> <return-value> <constraint annotation="GenericAndCrossParameterConstraint"> <element name="validationAppliesTo">RETURN_VALUE</element> </constraint> /return-value> </method>

Note that the spec doesn't mandate the suggested behavior, but I think it would make sense to support it for the ease of use.

Environment

None

Status

Assignee

Gunnar Morling

Reporter

Gunnar Morling

Components

Fix versions

Affects versions

5.0.0.CR3

Priority

Major