Provide a way for accessing default implementations for XML configured bootstrap
artifacts
------------------------------------------------------------------------------------------
Key: BVAL-224
URL:
http://opensource.atlassian.com/projects/hibernate/browse/BVAL-224
Project: Bean Validation
Issue Type: New Feature
Components: spec-general
Reporter: Gunnar Morling
Using {{validation.xml}} one can specify custom implementations for constraint validator
factory, message interpolator etc. Right now there is no way to delegate from within these
custom implementations to the default ones. This would be possible when using the
configuration API:
{code}
HibernateValidatorConfiguration configuration =
Validation.byProvider(HibernateValidator.class).configure();
ConstraintValidatorFactory defaultFactory =
configuration.getDefaultConstraintValidatorFactory();
ConstraintValidatorFactory customFactory = new
CustomConstraintValidatorFactory(defaultFactory);
configuration.constraintValidatorFactory(customFactory);
{code}
One idea to allow for such a delegation is to support constructors taking the default
implementation as parameter:
{code}
CustomConstraintValidatorFactory implements ConstraintValidatorFactory {
ConstraintValidatorFactory delegate;
CustomConstraintValidatorFactory(ConstraintValidatorFactory defaultFactory) {
this.delegate = defaultFactory;
}
}
{code}
For XML-configured artifacts the runtime could invoke this delegate constructor if
existent, otherwise the default constructor could be invoked.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira