|
Re: Stereotype attribute with unsettable value [message #476972 is a reply to message #476938] |
Fri, 22 February 2008 14:23 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Dave,
It should be possible to make a stereotype property unsettable using the
Ecore profile as you've suggested. The type of the property need not
necessarily be a wrapper type - you should be able to make int and boolean
properties (for example) unsettable as well.
To be certain, what kind of effect were you expecting? The value of an
unsettable feature in EMF (on which the profile implementation is based)
will only be serialized iff it has been explicitly set, and the answer to
EObject#eIsSet(EStructuralFeature) will only return true iff a value has
been explicitly set (independantly of the default value)...
Kenn
"Dave Carlson" <dcarlson@xmlmodeling.com> wrote in message
news:fp4p5q$q2c$1@build.eclipse.org...
> Is is possible to define a stereotype attribute, with Integer or Boolean
> value, where the value is unsettable (i.e. will have a null value by
> default) when applied in a model? I would expect that the defined profile
> would need to use java Integer or Boolean, instead of int and boolean, so
> that the value may be null.
>
> I tried applying the Ecore profile to my Profile, then applying
> <<eAttribute>> and marking these attributes as unsettable, but this does
> not seem to have any effect.
>
> Thanks,
> Dave
>
|
|
|
Re: Stereotype attribute with unsettable value [message #626071 is a reply to message #476938] |
Fri, 22 February 2008 14:23 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Dave,
It should be possible to make a stereotype property unsettable using the
Ecore profile as you've suggested. The type of the property need not
necessarily be a wrapper type - you should be able to make int and boolean
properties (for example) unsettable as well.
To be certain, what kind of effect were you expecting? The value of an
unsettable feature in EMF (on which the profile implementation is based)
will only be serialized iff it has been explicitly set, and the answer to
EObject#eIsSet(EStructuralFeature) will only return true iff a value has
been explicitly set (independantly of the default value)...
Kenn
"Dave Carlson" <dcarlson@xmlmodeling.com> wrote in message
news:fp4p5q$q2c$1@build.eclipse.org...
> Is is possible to define a stereotype attribute, with Integer or Boolean
> value, where the value is unsettable (i.e. will have a null value by
> default) when applied in a model? I would expect that the defined profile
> would need to use java Integer or Boolean, instead of int and boolean, so
> that the value may be null.
>
> I tried applying the Ecore profile to my Profile, then applying
> <<eAttribute>> and marking these attributes as unsettable, but this does
> not seem to have any effect.
>
> Thanks,
> Dave
>
|
|
|
Powered by
FUDForum. Page generated in 0.01999 seconds