Skip to main content



      Home
Home » Modeling » UML2 » Stereotype attribute with unsettable value
Stereotype attribute with unsettable value [message #476938] Fri, 15 February 2008 14:29 Go to next message
Eclipse UserFriend
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 #476972 is a reply to message #476938] Fri, 22 February 2008 09:23 Go to previous message
Eclipse UserFriend
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 09:23 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:IllegalArgumetnException when applying a stereotyp
Next Topic:.uml vs. .xmi
Goto Forum:
  


Current Time: Tue Jul 08 09:25:37 EDT 2025

Powered by FUDForum. Page generated in 0.07526 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top