use of jakarta.validation.ValidatorContext in project mojarra by eclipse-ee4j.
the class BeanValidator method getBeanValidator.
// ----------------------------------------------------- Private helper methods for bean validation
// MOJARRA IMPLEMENTATION NOTE: identical code exists in Mojarra's com.sun.faces.util.BeanValidation
private static jakarta.validation.Validator getBeanValidator(FacesContext context) {
ValidatorFactory validatorFactory = getValidatorFactory(context);
ValidatorContext validatorContext = validatorFactory.usingContext();
MessageInterpolator facesMessageInterpolator = new FacesAwareMessageInterpolator(context, validatorFactory.getMessageInterpolator());
validatorContext.messageInterpolator(facesMessageInterpolator);
return validatorContext.getValidator();
}
Aggregations