[hibernate-issues] [Hibernate-JIRA] Commented: (BVAL-224) Provide a way for accessing default implementations for XML configured bootstrap artifacts

Gunnar Morling (JIRA) noreply at atlassian.com
Mon Sep 26 16:53:35 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/BVAL-224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43698#comment-43698 ] 

Gunnar Morling commented on BVAL-224:
-------------------------------------

Should have.

> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list