It allows to convert Set<ConstraintViolation> to BindingResult(BindException). So it has pottential of being used outside spring framework may be jax-rs, jax-ws in following manner:
We can validate the bean using bean validation api.
Convert Set<ContraintViolations> to BindingResult using above method
Use that binding result to report good validation messages in any rest or soap java web api frmeaork.
Making that method protected is conflicting with above use case. Or we can have similar pblic interface to convert Ser<ConstrainViolation> to BindingResult.
Even some api framework like jax-ws jesey have integration for bean validation api and through constraintvoilationexception. this exception has set<constrainviolations>. Right now we don;t have any interface in LocalValidatorFactory to convert it to bindingresult. The advantage bindingresult
has is by using it we can easily prepare validation errors for user in any framework.
Affects: 5.0.9, 5.1 GA
The text was updated successfully, but these errors were encountered:
The goal for this component is purely to adapt Standard Validation as a Spring Validator so it can be configured within Spring infrastructure. It is not a good fit for and not a goal to support its use within other frameworks.