2
votes

I am a beginner in Eclipse EMF. I have created an Ecore metamodel which I want to transform into a new Ecore metamodel in Java that takes into account some characteristics of the first metamodel. I have searched the web but the exlpanations I've found were not clear to me.

How can I get access to the first metamodel from a Java app and how can I generate a new metamodel with the corresponding .ecore and .genmodel files?

Is such a task even possible?

Thanks!

2
why do you want to generate a new model? have you thought about changing it with edapt and creating a new release? - Sunny Onesotrue

2 Answers

0
votes

There is EMF Epsilon language framework which you can use for model transformations. It is written in Java and can be used in java applications. Here is an example.

0
votes

You can access in this way :

ResourceSet rs = new ResourceSetImpl();
Resource resource = rs.getResource(URI.createFileURI(metamodelStringURI), true);