reval
reval

Reputation: 11

Represent UML2 Stereotypes in EMF Ecore format to generate Java code via JET

working with Eclipse EMF, i am trying to convert a uml2-model (i.e. defined as xmi) with applied profiles to ecore to be able to manipulate the code generation. Anyone has an idea on how this could be done nicely? As it is not possible out of the box I would figure that I would need to find a way to manipulate the way the xmi gets tranformed to ecore to represent the stereotypes in some 'ecore'-way, so that I can read them in my JET-Template...

Thanks a lot for pointing me in the right direction!

PS: This post is very related to what I want to achieve How to generate 'java code with annotations' from emf model

Upvotes: 1

Views: 1200

Answers (2)

UML GURU
UML GURU

Reputation: 1462

It is not possible to generate annotation from EMF directly you need to use an UML tool.

Upvotes: 0

awynne
awynne

Reputation: 437

I have not done this before, but I think what you need to do is use the eclipse MDT/UML2 project, which helps read in your UML model file to produce an EMF model. From there, you can use the typical EMF code generation features to generate the code or templating features to generate your own custom code. There is an FAQ entry which addresses how to do this:

The UML2 project provides an Ecore importer that can be used to create Ecore (.ecore) and generator (.genmodel) models from a UML (.uml) model via the EMF project wizard ... Ultimately, UML2 uses the code generation facilities provided by EMF.

Upvotes: 0

Related Questions