[ 
https://issues.apache.org/jira/browse/ISIS-249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Haywood updated ISIS-249:
-----------------------------
    Summary: [WON'T FIX] Fail early for enums that have no default and are 
mandatory.  (was: Fail early for enums that have no default and are mandatory.)

> [WON'T FIX] Fail early for enums that have no default and are mandatory.
> ------------------------------------------------------------------------
>
>                 Key: ISIS-249
>                 URL: https://issues.apache.org/jira/browse/ISIS-249
>             Project: Isis
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 0.2.0-incubating
>            Reporter: Dan Haywood
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> ... such that this would be an error, showing up as a ValidationFailure in 
> the MetaModelValidator:
>     // {{ Gender (attribute)
>     private PersonGenderType gender;
>     @MemberOrder(sequence = "4")
>     public PersonGenderType getGender() {
>         return gender;
>     }
>     public void setGender(final PersonGenderType gender) {
>         this.gender = gender;
>     }
>     
>     // }}
>       
>       
>       
>       
> but this would be ok, because the programmer has provided an explicit default 
> method: 
>       
>           // {{ Gender (attribute)
>     private PersonGenderType gender;
>     @MemberOrder(sequence = "4")
>     public PersonGenderType getGender() {
>         return gender;
>     }
>     public void setGender(final PersonGenderType gender) {
>         this.gender = gender;
>     }
>     
>     public PersonGenderType defaultGender() {
>         return PersonGenderType.UNKNOWN;
>     }
>     // }}
>       
>       
>       
> and this would be ok, because the property is optional
>       
>           // {{ Gender (attribute)
>     private PersonGenderType gender;
>     @MemberOrder(sequence = "4")
>     @Optional
>     public PersonGenderType getGender() {
>         return gender;
>     }
>     public void setGender(final PersonGenderType gender) {
>         this.gender = gender;
>     }
>     // }}     



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to