3.5. Viewing Kermeta metamodel

[Warning]Text not verified for kermeta 2

In Kermeta, you can view its metamodel by several ways.

First, the ecore file kermeta_java.ecore is available in the lib folder of Kermeta main plugin.It is used when saving a Kermeta program in XMI ("Compile to XMI" function on *.kmt files). You can then load Kermeta program as a model, typically to transform it.

[Warning]Warning

You should not try to execute operations on Kermeta models you've just dynamically created unless you froze it. This is a feature which has not been completly tested.

Another typical way to access to a Kermeta model and Kermeta metamodel is to use the reflection. All objects inherits from Object that defines the getMetaClass operation. This use is used in one of the samples of Section 2.20, “ Dynamic evaluation of Kermeta expressions ” (when it selects an operation to be executed).

At last, the parse method on dynamic expression presented in section Dynamic evaluation of Kermeta expressions can give you some way to access a Kermeta model as it parses a Kermeta text and provides the corresponding model.