0

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

4

1 回答 1

1
myModel.eClass().getEPackage()

为您提供用于当前模型的包,从那里您可以使用包注册表查看它是否与您选择的已注册元模型匹配。

EPackage.Registry.eINSTANCE.values()

我建议使用元模型的 NsURI 进行检查。如果模型的代码是用 EMF 正常生成的,那就没问题了,因为 NsURI 是元模型的唯一标识符。

myModel.eClass().getEPackage().getNsURI()
于 2012-10-31T13:05:59.357 回答