Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to set & get data from a stereotype's properties
How to set & get data from a stereotype's properties [message #478190] Thu, 12 February 2009 14:44 Go to next message
maniel  is currently offline maniel Friend
Messages: 7
Registered: July 2009
Junior Member
Hi,

I created a stereotype properties which is using another "Type" I defined
within same profile. How can I use set and get value from this properties
using api?

I use RSM's properties editor, I can input single or multiple instances of
data to this properties. It seems the value is held within a list.

Now the questions are:
1. Should I use a custom type in stereotype properties? Or I should define
another stereotype and use it in properties?

2. I know RSM is using ClassImpl to represent a Profile's type, but how can
I use uml2 setValue() or getValue() to add & retrieve data from it?

Thanks
Maniel
Re: How to set & get data from a stereotype's properties [message #478214 is a reply to message #478190] Fri, 27 February 2009 20:05 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Maniel

If I'm not mistaken, RSMs property editor will obtain the structural feature
from the DynamicEObject representation of the Stereotype application and
then set the types using EMF.

However, the setValue() should be sufficient. For simple use of
setValue(), the wiki has this article:
http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Intro duction_to_UML2_Profiles/article.html

For setting multi-valued properties, the final Object parameter would have
to be some instance of java.util.List. The elements in the list would need
to conform to the property type . Internally the setValue() method creates
a new list and calls eSet using the new list.

Cheers,
- James.

"maniel " <maniel_leong@shaw.ca> wrote in message
news:a0f274129ecf8461f608c27e125de659$1@www.eclipse.org...
> Hi,
>
> I created a stereotype properties which is using another "Type" I defined
> within same profile. How can I use set and get value from this properties
> using api?
>
> I use RSM's properties editor, I can input single or multiple instances of
> data to this properties. It seems the value is held within a list.
>
> Now the questions are:
> 1. Should I use a custom type in stereotype properties? Or I should define
> another stereotype and use it in properties?
>
> 2. I know RSM is using ClassImpl to represent a Profile's type, but how
> can
> I use uml2 setValue() or getValue() to add & retrieve data from it?
>
> Thanks
> Maniel
>
>
Re: How to set & get data from a stereotype's properties [message #627409 is a reply to message #478190] Fri, 27 February 2009 20:05 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Maniel

If I'm not mistaken, RSMs property editor will obtain the structural feature
from the DynamicEObject representation of the Stereotype application and
then set the types using EMF.

However, the setValue() should be sufficient. For simple use of
setValue(), the wiki has this article:
http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Intro duction_to_UML2_Profiles/article.html

For setting multi-valued properties, the final Object parameter would have
to be some instance of java.util.List. The elements in the list would need
to conform to the property type . Internally the setValue() method creates
a new list and calls eSet using the new list.

Cheers,
- James.

"maniel " <maniel_leong@shaw.ca> wrote in message
news:a0f274129ecf8461f608c27e125de659$1@www.eclipse.org...
> Hi,
>
> I created a stereotype properties which is using another "Type" I defined
> within same profile. How can I use set and get value from this properties
> using api?
>
> I use RSM's properties editor, I can input single or multiple instances of
> data to this properties. It seems the value is held within a list.
>
> Now the questions are:
> 1. Should I use a custom type in stereotype properties? Or I should define
> another stereotype and use it in properties?
>
> 2. I know RSM is using ClassImpl to represent a Profile's type, but how
> can
> I use uml2 setValue() or getValue() to add & retrieve data from it?
>
> Thanks
> Maniel
>
>
Previous Topic:Subsetted/Redefined Property -> DanglingHREF
Next Topic:uml.ecore and ecore.ecore
Goto Forum:
  


Current Time: Fri Apr 19 15:18:33 GMT 2024

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

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

Back to the top