Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » getValue and 1..*(How can i access to a list of a stereotype's property ?)
getValue and 1..* [message #673418] Mon, 23 May 2011 15:09 Go to next message
Valerian Merkling is currently offline Valerian MerklingFriend
Messages: 71
Registered: May 2011
Member
Hi !

I've got a Stereotype with a few attributes, but one of thoses got a 1..* multiplicity.

While i can cast the getValue object in a DynamicEObjectImpl for 1..1, and then use dynamicGet(0) to obtain the needed object, everythings i tried with 1..* property return void.

Can someone help me for this ?

Thanks !
Re: getValue and 1..* [message #673954 is a reply to message #673418] Wed, 25 May 2011 09:25 Go to previous messageGo to next message
Mikael Barbero is currently offline Mikael BarberoFriend
Messages: 55
Registered: July 2009
Member
If your stereotype's attribute is 1..*, Element.getValue(Steretotype, String) should return a List.

You may try to get the tagged value directly from your stereotype application on your element:

// eObject here is the holder of tagged values
EObject eObject = element.getStereotypeApplication(stereotype);

then, try to get the value of the your stereotype feature:

EStructuralFeature eSF = eObject.eClass().getEStructuralFeature(nameOfYourStereotypeAttribute);
Object taggedValue = eObject.eGet(eSF);

Debug the type of taggedValue, you should have some clues Wink I suggest also you post your question on the MDT-UML2 forum as they are the real UML2 specialists!

Best Regards,
Mikael


Best regards,

Mikael Barbero
Obeo
Re: getValue and 1..* [message #674572 is a reply to message #673954] Fri, 27 May 2011 11:43 Go to previous message
Valerian Merkling is currently offline Valerian MerklingFriend
Messages: 71
Registered: May 2011
Member
Nice ! Thanks, i'll try it
Previous Topic:Copy files unsing the MWE2 workflow
Next Topic:[Acceleo] Cross models reference + Java Application
Goto Forum:
  


Current Time: Sat Dec 07 03:32:55 GMT 2024

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

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

Back to the top