I'm using Hibernate Validator and added some custom validation annotations, resource bundle location and a custom message interpolator. This is all done by customizing the Validator at bootstrapping time.
Now I'm trying to validate methods, but of course I don't get my nicely configured Validator, since the standard Validator is injected for @AutoValidating.
How can I customize the Validator within Seam Validation?
Here's how I create the Validator:
public static javax.validation.Validator getBeanValidator(final Locale locale,
final ResourceBundle... resourceBundles) {
HibernateValidatorConfiguration configuration = Validation.byProvider(HibernateValidator.class).configure();
FallbackResourceBundleLocator resourceBundleLocator = new FallbackResourceBundleLocator(
configuration.getDefaultResourceBundleLocator(), resourceBundles);
configuration.messageInterpolator(new FieldMessageInterpolator(locale, resourceBundleLocator));
javax.validation.ValidatorFactory validatorFactory = configuration.buildValidatorFactory();
return validatorFactory.getValidator();
}