[hibernate-issues] [Hibernate-JIRA] Commented: (BVAL-235) Support parameterized payload attributes

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


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

Gunnar Morling commented on BVAL-235:
-------------------------------------

Nice to have.

> Support parameterized payload attributes
> ----------------------------------------
>
>                 Key: BVAL-235
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-235
>             Project: Bean Validation
>          Issue Type: New Feature
>          Components: spec-general
>    Affects Versions: 1.0 final
>            Reporter: Sebastian Thomschke
>
> JSR303's payload attribute values are limited to class references. 
> The idea is to allow the specification of an additional String value for each payload declaration allowing more flexible configurations.
> For example:
> public @interface Payload {
>     Class< ? > type();
>     String value();
> }
>  
> @interface MinLength {
>   Payload[] payload() default {};
>   // ...
> }
>  
> class Account
> {
>   @MinLength(value=4, payload = {
>      @Payload(type=ErrorCode.class, value="1234"),
>      @Payload(type=When.class, value="groovy:this.owner != null && this.foobar > 3")
>   })
>   String name;
> }

--
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