Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Access metamodel elemnets from model
Access metamodel elemnets from model [message #1287142] Mon, 07 April 2014 12:58 Go to next message
Adnan AL-SOSWA is currently offline Adnan AL-SOSWAFriend
Messages: 41
Registered: May 2010
Member
Hi all ,

I have question if you please ,
I use Xpand language to generate code from model , and I am wondering if it is possible from model Level to access to metamodel components

for example : I have mymetamodel.ecore and I created instance of it model.xmi
now I am trying to make template general for all models that conform to mymetamodel.ecore , is there any way that give me the result that code in red (as it only what I need and not correct) , I do not want to write template to generate template.
«IMPORT [color=darkred]model.metatype.name[/color]»

«DEFINE main FOR ecore::EObject»
«EXPAND autoname FOREACH [color=darkred]this.eAllContents()[/color]-»

«DEFINE autoname FOR  this.metatype.name -»
 [color=darkred]this.metatype.name[/color] [«EXPAND reference FOREACH [color=darkred]this.refrences.name [/color]SEPARATOR ', '»]). 

«ENDDEFINE»

Re: Access metamodel elemnets from model [message #1287326 is a reply to message #1287142] Mon, 07 April 2014 17:15 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi am not sure if i get your question but cant you ask an eObject for its eclass?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Acceleo - Differences between generations runner
Next Topic:How to import ecore2ecore in template?
Goto Forum:
  


Current Time: Thu Apr 25 21:13:27 GMT 2024

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

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

Back to the top