Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Stereotype attribute with unsettable value
Stereotype attribute with unsettable value [message #476938] Fri, 15 February 2008 19:29 Go to next message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
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 14:23 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
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 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
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
>
Previous Topic:IllegalArgumetnException when applying a stereotyp
Next Topic:.uml vs. .xmi
Goto Forum:
  


Current Time: Fri Aug 19 02:28:04 GMT 2022

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

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

Back to the top