use of org.glassfish.hk2.utilities.general.internal.MessageInterpolatorImpl in project glassfish-hk2 by eclipse-ee4j.
the class ValidatorUtilities method initializeValidator.
private static Validator initializeValidator() {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(HibernateValidator.class.getClassLoader());
ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory();
ValidatorContext validatorContext = validatorFactory.usingContext();
validatorContext.messageInterpolator(new MessageInterpolatorImpl());
return validatorContext.traversableResolver(TRAVERSABLE_RESOLVER).getValidator();
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}
Aggregations