-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
Description
I would like to use a ResourceBundleMessageInterpolator in combination with an AggregateResourceBundleLocator for resolving my JSR 303 validation messages from multiple ValidationMessages.properties files. I have not seen an API for setting the MessageInterpolator when using DefaultFXFormValidator so as a workaround I subclassed it and used this code in the constructor of the subclass :
factory = Validation.byDefaultProvider()
.configure()
.messageInterpolator(new ResourceBundleMessageInterpolator(new AggregateResourceBundleLocator(bundleNames)))
.buildValidatorFactory();
this.validator = factory.getValidator();
this.messageInterpolator = factory.getMessageInterpolator();
Is there a better way to do it? Ideally, I would only need to call a setter on my DefaultFXFormValidator instance to use another MessageInterpolator.
Thank you for your efforts and your support.