What is the easieset way to see that an ecore-model is the model of a metamodel. I'm not interested in OCL, just that the model is a concrete model derived from the metamodel. I want to do this using Sphinx or any other API in eclipse
Asked
Active
Viewed 118 times
1 Answers
1
myModel.eClass().getEPackage()
Gives you the package used for your current model, from there you can use the package registry to see if it matches the registered metamodel of your choice.
EPackage.Registry.eINSTANCE.values()
I would recommend checking this with the NsURI of the metamodel. If the code of the model has been normally generated with EMF, it will be fine since the NsURI is the unique identifier of the meta-model.
myModel.eClass().getEPackage().getNsURI()

sbegaudeau
- 1,504
- 13
- 18
-
It partialy works, but i also have to look in the content, because several metamodels could be in the registry – Viktor Mellgren Nov 14 '12 at 16:14