Hi,
This will be possible out of the box with Bean Validation 1.1 and Hibernate Validator 5 (to be released soon).
For now you could configure your custom interpolator using CDI (e.g. by having it injected into a CDI bean) and pass it when bootstrapping a validator:
Code:
@ApplicationScoped
public class ValidatorProducer {
@Inject
private MessageInterpolator interpolator;
@Produces
public Validator createValidator() {
Configuration<?> configuration = Validation.byDefaultProvider().configure();
ValidatorFactory factory = configuration
.messageInterpolator( interpolator )
.buildValidatorFactory();
return factory.getValidator();
}
}
--Gunnar