除了使用类级验证之外,还有没有办法从其验证器类中访问字段级验证注释的父 bean?
例如:
public class CustomValidator implements ConstraintValidator<CustomValidation, String> {
@Override
public void initialize(final CustomValidation constraintAnnotation) {
}
@Override
public boolean isValid(final String fieldValue, final ConstraintValidatorContext context) {
// is there a way to access the parent object here?
}
}