Chapter 1. Introduction to the Kermeta MDK

The Model Development Kit for Kermeta contains various kind of codes that work with Kermeta models: some helper classes and some transformations.

[Tip]Tip

To use them you simply have to add the corresponding require statement to your kermeta code. Then, the outline and the KermetaDoc views should help you to use its content.

1.1. Short description of the available require

Kermeta MDK available files

Currently, the MDK provides the following files :

require "platform:/plugin/org.kermeta.language.mdk/src/kmt/language/visitor/kermetaVisitor.kmt"

This file adds a visitor to Kermeta metamodel. It helps you traverse a Kermeta model.

require "platform:/plugin/org.kermeta.language.mdk/src/kmt/language/helpers/AllHelpers.kmt"

This file adds various helper operations to the Metaclasses of Kermeta.

[Tip]Tip

If you are interested in only a subset of those helpers, you can directly require the corresponding files in the helpers directory of the plugin.

require "platform:/plugin/org.kermeta.language.mdk/src/kmt/language/helpers/structure/AllStructureHelpers.kmt"

Same as AllHelpers.kmt except that it provides only helpers on classes of the structure package.

require "platform:/plugin/org.kermeta.language.mdk/src/kmt/language/extension/SingletonSupport.kmt"

This files adds a support for getting a kind of singleton in Kermeta.

See the presentation done for Kermeta days 09 http://www.kermeta.org/community/workshop/09/slides/Vojtisek-KermetaDay09-Singleton.pdf

require "platform:/plugin/org.kermeta.language.mdk/src/kmt/math/Math.kmt"

Provides a kermeta::Math class that offers some of the classical operation like sin, cos, pi, toDegrees, toRadians, etc

require "platform:/plugin/org.kermeta.language.mdk/src/kmt/language/visitor/prettyprinters/kmtPrettyPrinter.kmt"

This file adds a KMT prettyprinter visitor to Kermeta metamodel. It provides a String output of the kmt surface syntax for your km models.

require "platform:/plugin/org.kermeta.language.mdk/src/kmt/standard/StringUtils.kmt"

This file adds some String manipulation operations to String. for example trim(), startsWith(), endsWiths(), etc

require "platform:/plugin/org.kermeta.language.mdk/src/kmt/utils/Random.kmt"

This file offers some operations to get random elements. (Currently, random numbers, but can/should be extended)

require "platform:/plugin/org.kermeta.language.mdk/src/kmt/utils/Date.kmt"

This file offers some operations to calculate elapsed time.

require "platform:/plugin/org.kermeta.language.mdk/src/kmt/utils/Properties.kmt"

This file offers an operation to get properties as a Hashtable<String, String> from a Properties file.