I am writing code that has explicit call to Bean Validation (JSR-303) something like this:
public class Example {
@DecimalMin(value = \"0\")
private
You should declare a group for the constraints you validate in that case. Then you can call the normal validation for that group. See sections 2.1.1.2 and section 3.4 of the spec for group definitions and their semantics. For validating the group, you then just need to call Validator.validate(T Object, Class>... groups)
. There is no need to mess around with the ConstraintValidatorContext
in this case.