Kermeta API Documentation

Generation date: Jan 30, 2007
API : kermeta • kermeta::interpreter • kermeta::persistence • kermeta::kunit • kermeta::language • kermeta::exceptions • kermeta::io • kermeta::reflection • kermeta::utils • kermeta::standard • kermeta::language::behavior • kermeta::language::structure

Package kermeta

kermeta
The root package. See the other packages if you want to browse the classes of Kermeta api.

Package interpreter

kermeta::interpreter

Contains a set of classes whose function is to evaluate a kermeta
expression written as a string.

Operation evalString

operation evalString(body : kermeta::standard::String, selfObj : kermeta::standard::Object, actualParams : kermeta::utils::Hashtable<kermeta::standard::String, kermeta::standard::Object>) : kermeta::standard::Object

Execute the expression given as a string.
the self type and formal parameters are supposed to be set
before calling this operation

Operation execute

operation execute(selfObj : kermeta::standard::Object, actualParams : kermeta::utils::Hashtable<kermeta::standard::String, kermeta::standard::Object>) : kermeta::standard::Object

Execute the expression in the given context

Operation initializeDefaults

operation initializeDefaults() : Void

initialise the formalParameters with an empty set of parameters
and the self type with void

Operation parse

operation parse(expression : kermeta::standard::String) : kermeta::standard::Boolean

Parse the expression as a string
and updates the expression field and errors
Returns true if the expression was parssed sucessfuly

Property errors

reference errors: kermeta::interpreter::KermetaError[0..*]

Parse errors and type errors

Property expression

reference expression: kermeta::language::behavior::Expression

the expression

Property formalParameters

reference formalParameters: kermeta::utils::Hashtable<kermeta::standard::String, kermeta::reflection::Type>

Formal parameters of the expression

Property selfClass

reference selfClass: kermeta::reflection::ClassDefinition

The type of the self object
or void if the expression is not to be executed
in the context of an object

Class DynamicExpression

kermeta::interpreter::DynamicExpression

DynamicExpression is a class used to make dynamic calls, i.e dynamic evaluation
of Kermeta statements represented in a string.

An example :
var de : DynamicExpression init DynamicExpression.new
de.initializeDefaults
de.formalParameters.put("a", String)
de.parse("stdio.writeln(a)") // note: to execute a list of statements, you have to surround them with do..end
var params : Hashtable<String, Object> init Hashtable<String, Object>.new
params.put("a", "hello world!")
de.execute(void, params)

Class DynamicExpressionException

kermeta::interpreter::DynamicExpressionException inherits kermeta::exceptions::Exception
See inherited classes.

Property message

attribute message: kermeta::standard::String
Undocumented

Class KermetaError

kermeta::interpreter::KermetaError
Undocumented

Class ParseError

kermeta::interpreter::ParseError inherits kermeta::interpreter::KermetaError
See inherited classes.

Class TypeError

kermeta::interpreter::TypeError inherits kermeta::interpreter::KermetaError
See inherited classes.

Package persistence

kermeta::persistence

Contains the classes that handle the serialization of models, in particular
EMF models.

Operation createResource

method createResource(uri : kermeta::standard::String, mm_uri : kermeta::standard::String) : kermeta::persistence::Resource from kermeta::persistence::Repository
Undocumented

Operation getResource

method getResource(uri : kermeta::standard::String) : kermeta::persistence::Resource from kermeta::persistence::Repository
Undocumented

Property useInterpreterInternalResources

attribute useInterpreterInternalResources: kermeta::standard::Boolean

If true, tells to the save of the resources that they should also integrate the resources from Kermeta interpreter itself
this is usefull for example to make a dependency to framework.km
by default, not setting this is considered as false.

Class EMFRepository

kermeta::persistence::EMFRepository inherits kermeta::persistence::Repository

Repository that stores and manages resources that come from EMF

Operation add

method add(instance : kermeta::standard::Object) : Void from kermeta::persistence::Resource
Undocumented

Operation initializeContentMap

operation initializeContentMap() : Void

Create an hashtable with appropriates keys and empty collections. This method
should not be called by the end-user

Operation isInTypeDefSet

operation isInTypeDefSet(tparams : kermeta::standard::Set<kermeta::reflection::TypeDefinition>, new_instance : kermeta::standard::Object) : kermeta::standard::Boolean

Helper that returns true if new_instance type is in the tparam Set, false otherwise
FIXME : Loop-and-cast done in order to temporarily get round the type
system limits for reflection

Operation load

method load() : Void from kermeta::persistence::Resource
Undocumented

Operation remove

method remove(instance : kermeta::standard::Object) : kermeta::standard::Object from kermeta::persistence::Resource
Undocumented

Operation save

method save() : Void from kermeta::persistence::Resource
Undocumented

Operation saveAndValidateWithEMF

operation saveAndValidateWithEMF() : kermeta::standard::Boolean
save and check the resource using the EMF validation function
apply the validate on all the object in the root of this resource
returns true if the validation reports no error
otherwise raises exceptions

Operation saveWithNewURI

method saveWithNewURI(new_uri : kermeta::standard::String) : Void from kermeta::persistence::Resource
Undocumented

Class EMFResource

kermeta::persistence::EMFResource inherits kermeta::persistence::Resource

Extension of the Resource class definition that is specific to EMF Repository.

Operation createResource

method createResource(uri : kermeta::standard::String, mm_uri : kermeta::standard::String) : kermeta::persistence::Resource from kermeta::persistence::Repository
Undocumented

Operation getResource

method getResource(uri : kermeta::standard::String) : kermeta::persistence::Resource from kermeta::persistence::Repository
Undocumented

Class KMRepository

kermeta::persistence::KMRepository inherits kermeta::persistence::Repository

Repository that stores and manages XMI files representing Kermeta models

Operation add

method add(instance : kermeta::standard::Object) : Void from kermeta::persistence::Resource
Undocumented

Operation load

method load() : Void from kermeta::persistence::Resource
Undocumented

Operation remove

method remove(instance : kermeta::standard::Object) : kermeta::standard::Object from kermeta::persistence::Resource
Undocumented

Operation save

method save() : Void from kermeta::persistence::Resource
Undocumented

Class KMResource

kermeta::persistence::KMResource inherits kermeta::persistence::Resource
See inherited classes.

Operation createResource

operation createResource(uri : kermeta::standard::String, mm_uri : kermeta::standard::String) : kermeta::persistence::Resource

Create a resource with given uri.
params :
- uri : the uri where to save the model handled by the resource
- mm_uri : the uri of the metamodel of which model is an instance
User must provide the mm_uri if he creates a new model from scratch.

Create a new resource for a model given by its uri,
which meta-model is stored in file given by mm_uri
If file already exists, you'll be able to call the load method to concretly load the model
otherwise, you can only call the save method

Operation getResource

operation getResource(uri : kermeta::standard::String) : kermeta::persistence::Resource

Get the resource of model that is stored in the given uri.
This suppose that this URI resource was already created in this Repository.
If this resource wasn't already created it will silently create
and load a new one. In this case, the

Get the resource of model that is stored in the given uri. Silently create
and load a new one if a resource with this uri was not found.

Property resources

attribute resources: set kermeta::persistence::Resource[0..*]#repository
The resources created by this repository

Class Repository

kermeta::persistence::Repository
Abstract resource container, that contains a list of available loaded resources,
and methods to create or get a resource given an URI.

Operation add

operation add(instance : kermeta::standard::Object) : Void
add an instance, return it if success, otherwise return null
You need to do that for every Object that must be placed in the root of the resource when you'll save it Add an instance to the Resource ( this is only a shortcut to instances.add call)

Operation load

operation load() : Void
Loads a resource. Once loaded, you'll be able to query the resource for its content. Loads a resource. Once loaded, you'll be able to query the resource for its instances.

Operation remove

operation remove(instance : kermeta::standard::Object) : kermeta::standard::Object
remove the instance, return it if success, otherwise return null Remove an instance from the Resource

Operation save

operation save() : Void
Save a model instance, in the file specified by the initial uri
Overrides the old version.
Save a resource in a file referenced by the uri associated to the resource

Operation saveWithNewURI

operation saveWithNewURI(new_uri : kermeta::standard::String) : Void
Save a resource in a file referenced by this new uri.
This allows to save the result of a transformation without changing the original file. Save a resource in a file referenced by this new uri.
This allows to save the result of a transformation without changing the original file.

Property allContents

property allContents: set kermeta::standard::Object[0..*] readonly
- returns all the model elements hosted by this resource, including elements from the
dependent resources

Property allRootContents

property allRootContents: set kermeta::standard::Object[0..*] readonly
- returns the rootContents of the model saved in/loaded from the given uri, including
the models from the dependent resources

Property contentMap

reference contentMap: kermeta::utils::Hashtable<kermeta::standard::String, kermeta::standard::Set<kermeta::standard::Object>>
The hashtable that contains the contents loaded by the resource.
It is composed of 4 entries : "rootContents", "allRootContents", "contents", "allContents"
The two last ones will be kept empty since resource-heavy
- rootContents : only the root elements of the "main model" hosted by the given resource
- allRootContents : the root elements of the main model

Property contents

property contents: set kermeta::standard::Object[0..*] readonly
- returns all the model elements hosted by this resource, excluding elements from the
dependent resources

Property includedResources

reference includedResources: set kermeta::standard::String[0..*]
The includedResource if the model-instance "inter-depends" on other instances

Property instances

reference instances: set kermeta::standard::Object[0..*]
The entities contained in the model-instance, that are provided when user loads a resource
instances == rootContents

Property metaModelURI

reference metaModelURI: kermeta::standard::String
The uri of the meta-model of the model-instance to load

Property repository

reference repository: kermeta::persistence::Repository#resources
The repository used to create this resource

Property rootContents

property rootContents: set kermeta::standard::Object[0..*] readonly

- returns the rootContents of the model saved in/loaded from the given uri, excluding
the models from the dependent resources

Property uri

reference uri: kermeta::standard::String
The uri of the model-instance to load

Class Resource

kermeta::persistence::Resource

The main class that handle a loaded/saved model.
There are a few important things to note for the developer :

- load a Resource : this loads a Collection of instances corresponding to the
objects in the loaded model. If the Collection of instances is empty, than
a ResourceLoadException is raised

- save a Resource : this saves the collection of instances in a new file. This can
be correctly done if and only if the instances saved are conform to the metamodel
linked to this resource (this link does not need to be explicit. It is normally retrieved
through the EMF model -- see Java wrapping "Resource.java").

- add/remove an instance to the Resource : this adds an element in the resource. It cannot
be "simply" added because of the following potential errors :

- The object added is not conform to the metamodel -> Error
- The object was already added in the resource -> Not a real error : we do nothing
- The object to remove does not exist -> redirect to a collection-specific error
- The object to remove is attached to an object in the collection -> "dependency-violation" exception?

Class ResourceLoadException

kermeta::persistence::ResourceLoadException inherits kermeta::exceptions::Exception
Specialized exceptions

Class ResourceSaveException

kermeta::persistence::ResourceSaveException inherits kermeta::exceptions::Exception
See inherited classes.

Class ResourceUnconformityException

kermeta::persistence::ResourceUnconformityException inherits kermeta::exceptions::Exception
Raised when user tries to add an object that is not conform to the metamodel

Package kunit

kermeta::kunit

Contains the implementation of a unit test tool. This is a clone of
JUnit architecture.
Reference : http://junit.sourceforge.net/doc/cookstour/cookstour.htm

Usage example of kunit can be found in fr.irisa.triskell.kermeta.samples project.

You can also find a little example if you go to the documentation of the class
TestRunner.

Operation assert

operation assert(bool : kermeta::standard::Boolean) : Void

Fails if bool is false

Operation assertFalse

operation assertFalse(bool : kermeta::standard::Boolean) : Void

will fail if bool is true

Operation assertFalseWithMsg

operation assertFalseWithMsg(bool : kermeta::standard::Boolean, msg : kermeta::standard::String) : Void

will fail if bool is true

Operation assertTrue

operation assertTrue(bool : kermeta::standard::Boolean) : Void

will fail if bool is false

Operation assertTrueWithMsg

operation assertTrueWithMsg(bool : kermeta::standard::Boolean, msg : kermeta::standard::String) : Void

will fail if bool is false

Operation fail

operation fail(msg : kermeta::standard::String) : Void

raise a AssertionViolatedException with the provided message

Operation order

operation order() : kermeta::standard::Integer

give the order number of the failed assert

Property rank

attribute rank: kermeta::standard::Integer
Undocumented

Class Assert

kermeta::kunit::Assert

The abstract class assert defines a set of convinient operations
to assert expected behavior and give the rank of failed assert

Class AssertionFailedError

kermeta::kunit::AssertionFailedError inherits kermeta::exceptions::Exception

AssertionViolatedException are raised when assertions are violated

Operation run

operation run(r : kermeta::kunit::TestResult) : Void

Run the test

Execute the test case

Execute all tests of the suite

Operation runTest

operation runTest() : Void
The main method that the testes has to implement for his specific tests
This method is an adapter that uses the pluggable selector TestCase.name to know which
test to run

Operation setUp

operation setUp() : Void
Called before a test is run to set up the needed environment

Operation tearDown

operation tearDown() : Void
Called each time a test is run so that the testing environment is always
tidy.

Class Test

kermeta::kunit::Test inherits kermeta::kunit::Assert

Abstract class Test. Interface for single and composite object (TestCase and TestSuite)

Operation createDefaultTestResult

operation createDefaultTestResult() : kermeta::kunit::TestResult
Undocumented

Operation initialize

operation initialize(name : kermeta::standard::String) : Void

Initialize the test case
params :
- name : the name of the test case : must be the name of the testOperation

Operation run

method run(r : kermeta::kunit::TestResult) : Void from kermeta::kunit::Test
Undocumented

Operation runTest

method runTest() : Void from kermeta::kunit::Test
Undocumented

Property name

attribute name: kermeta::standard::String
A name for the test case so that we know which one failed
This is a "pluggable" selector

Class TestCase

kermeta::kunit::TestCase inherits kermeta::kunit::Test

A test case contains a set of testOperations.
See TestRunner class to find how to run a TestCase.
Related design-pattern : Command

An Example of TestCase :
 class MyTestCase inherits kermeta::kunit::TestCase

{
attribute cString : String

method setUp() is do
cString := "String"
end

method tearDown() is do
// We don't need to tearDown anything in this example.
end

operation testStringAssignment() : Void is do
var aString : String init "String"
assert(aString==cString)
// You can also add a message if assert fails :
assertTrueWithMsg(aString==cString, "expected aString == cString")
end
}

Property failedTest

reference failedTest: kermeta::kunit::Test
Undocumented

Property raised

reference raised: kermeta::exceptions::Exception
Undocumented

Class TestFailure

kermeta::kunit::TestFailure

An instance of this class is created when an assertion failed or an exception
was raised.

Operation initialize

operation initialize() : Void
Undocumented

Operation loadTestMethodsFromTestCase

operation loadTestMethodsFromTestCase(test_type : kermeta::language::structure::Class) : kermeta::standard::Set<kermeta::kunit::Test>

load in the testSuiteClass all the methods prefixed by test
params :
- testCaseClass : the TestCase class where we get the testOperations
// FIXME / I would like to do "TestType inherits TestCase"

Property methodPrefix

attribute methodPrefix: kermeta::standard::String
Undocumented

Property suiteClass

reference suiteClass: kermeta::language::structure::Class
Undocumented

Class TestLoader

kermeta::kunit::TestLoader

Operation addError

operation addError(test : kermeta::kunit::Test, e : kermeta::exceptions::Exception) : Void
Undocumented

Operation addFailure

operation addFailure(test : kermeta::kunit::Test, e : kermeta::kunit::AssertionFailedError) : Void
Adds a failed test to the list of failed tests

Operation createTestFailure

operation createTestFailure(test : kermeta::kunit::Test, e : kermeta::exceptions::Exception) : kermeta::kunit::TestFailure
Undocumented

Operation initialize

operation initialize() : Void
Set the runtests to 0

Operation startTest

operation startTest(test : kermeta::kunit::Test) : Void
Increments the runtests counter

Property errors

reference errors: set kermeta::kunit::TestFailure[0..*]
tests which errors were not assertion failures

Property failures

reference failures: set kermeta::kunit::TestFailure[0..*]
tests which assertions failed

Property runtests

reference runtests: kermeta::standard::Integer
number of test that were run

Class TestResult

kermeta::kunit::TestResult

Get the number of run tests, errors and failures that resulted from the launch of a
Test. (This is a minimal but functional class that can be improved)
Related design-pattern : Collecting parameter

Operation createTestLoader

operation createTestLoader() : kermeta::kunit::TestLoader
Undocumented

Operation createTestResult

operation createTestResult() : kermeta::kunit::TestResult
Undocumented

Operation doesInheritFromTestCase

operation doesInheritFromTestCase(test_class : kermeta::reflection::Class) : kermeta::standard::Boolean

Recursively check if this class inherits from the class TestCase
this function is not really for external usage

Operation initialize

operation initialize() : Void
Undocumented

Operation printTestResult

operation printTestResult() : Void

Prints in a text format the result of the tests launches
TODO : a specific set of class that inherit TestResult and display
it according to a specific format

Operation run

operation run(test_class : kermeta::language::structure::Class) : Void
Run a test suite from the given test case (test_class should be a class
that inherits TestCase

Property testClass

reference testClass: kermeta::language::structure::Class
Undocumented

Property testResult

reference testResult: kermeta::kunit::TestResult
Undocumented

Class TestRunner

kermeta::kunit::TestRunner

User instantiates this class to run a TestSuite or a TestCase

Usage :

Create a file, and add in the "require" place :
require "the_file_that_contains_the_tests.kmt"


Create a class, which will be the one that you will launch :

class MyTesterClass
{
operation main() is do
var testRunner : kermeta::kunit::TestRunner init kermeta::kunit::TestRunner.new
// Here, we run our test case class called "TestClass",
// contained in the_file_that_contains_the_tests.kmt.
// TestClass must inherit TestCase, or TestSuite
testRunner.run(TestClass)
testRunner.printTestResult
end
}

Operation addTest

operation addTest(test : kermeta::kunit::Test) : Void
Undocumented

Operation run

method run(test_result : kermeta::kunit::TestResult) : Void from kermeta::kunit::Test
Undocumented

Operation runTest

method runTest() : Void from kermeta::kunit::Test
Undocumented

Property tests

reference tests: kermeta::kunit::Test[0..*]

The set of contained tests

Class TestSuite

kermeta::kunit::TestSuite inherits kermeta::kunit::Test

A test suite is composed of a set of tests (which can inherit either of TestSuite
or TestCase)
Related design-pattern : Composite

Package language

kermeta::language

Contains the implementation of Kermeta reflective collections.

Operation add

method add(element : G) : Void from kermeta::standard::Set
Undocumented

Operation clear

method clear() : Void from kermeta::standard::Collection
Undocumented

Operation remove

method remove(element : G) : Void from kermeta::standard::Collection
Undocumented

Class ReflectiveCollection

kermeta::language::ReflectiveCollection<G> inherits kermeta::standard::Set<G>

ReflectiveCollection is a special collection that is used to define the type
of attributes that have an upper multiplicity > 1 in a class. It indeed handles
the update of opposite property if such an attribute has got one.

Operation add

method add(element : G) : Void from kermeta::language::ReflectiveCollection
Undocumented

Operation addAt

method addAt(index : kermeta::standard::Integer, element : G) : Void from kermeta::standard::OrderedSet
Undocumented

Operation clear

method clear() : Void from kermeta::language::ReflectiveCollection
Undocumented

Operation remove

method remove(element : G) : Void from kermeta::language::ReflectiveCollection
Undocumented

Operation removeAt

method removeAt(index : kermeta::standard::Integer) : Void from kermeta::standard::OrderedCollection
Undocumented

Class ReflectiveSequence

kermeta::language::ReflectiveSequence<G> inherits kermeta::standard::OrderedSet<G>, kermeta::language::ReflectiveCollection<G>

ReflectiveSequence is an ordered ReflectiveCollection.

Package exceptions

kermeta::exceptions

Contains the definition of a Kermeta exception and a few basic exceptions.

Class AbstractClassInstantiationError

kermeta::exceptions::AbstractClassInstantiationError inherits kermeta::exceptions::RuntimeError

Creation on an abstract class. Usually this is detected by the type-checker. The only
case where this happens is when instantiating a type variable, whose bound type turns
out to be abstract.

Class CallOnVoidTarget

kermeta::exceptions::CallOnVoidTarget inherits kermeta::exceptions::RuntimeError

Occurs when a feature is called on void

Class ConstraintViolatedInv

kermeta::exceptions::ConstraintViolatedInv inherits kermeta::exceptions::Exception
See inherited classes.

Class ConstraintViolatedPost

kermeta::exceptions::ConstraintViolatedPost inherits kermeta::exceptions::Exception
See inherited classes.

Class ConstraintViolatedPre

kermeta::exceptions::ConstraintViolatedPre inherits kermeta::exceptions::Exception
See inherited classes.

Class DivisionByZero

kermeta::exceptions::DivisionByZero inherits kermeta::exceptions::Exception
See inherited classes.

Class EmptyCollection

kermeta::exceptions::EmptyCollection inherits kermeta::exceptions::Exception
See inherited classes.

Property message

attribute message: kermeta::standard::String

The message attached to the exception

Property nestedException

attribute nestedException: kermeta::exceptions::Exception

Any nested exception

Property stackTrace

attribute stackTrace: kermeta::standard::String

The stack trace as a String
Filled by the interpreted when the exception is raised

Class Exception

kermeta::exceptions::Exception

Generic exceptions
The main class from which all the exception inherit

Class IndexOutOfBound

kermeta::exceptions::IndexOutOfBound inherits kermeta::exceptions::Exception
See inherited classes.

Class IteratorIsOff

kermeta::exceptions::IteratorIsOff inherits kermeta::exceptions::Exception
See inherited classes.

Class NotImplementedException

kermeta::exceptions::NotImplementedException inherits kermeta::exceptions::RuntimeError

Use this exception whenyou want to forbid the access to an unimplemented operation
and invite to implement it

Class OverflowError

kermeta::exceptions::OverflowError inherits kermeta::exceptions::Exception
See inherited classes.

Property expression

attribute expression: kermeta::language::behavior::Expression

The code that raised the exception

Class RuntimeError

kermeta::exceptions::RuntimeError inherits kermeta::exceptions::Exception

Exception for interpreter exceptions

Class StringIndexOutOfBound

kermeta::exceptions::StringIndexOutOfBound inherits kermeta::exceptions::Exception
See inherited classes.

Class UpperBoundReachedError

kermeta::exceptions::UpperBoundReachedError inherits kermeta::exceptions::RuntimeError

Use this exception when user tries to add an element to a property which type is collection
which has an upper bound != -1 ( ie *)

Package io

kermeta::io

Contains Input/Output related classes.

Operation read

operation read(prompt : kermeta::standard::String) : kermeta::standard::String

read an object from standard input

Operation write

operation write(object : kermeta::standard::String) : Void

write the object to standard output

Operation writeln

operation writeln(object : kermeta::standard::String) : Void

writeln the object to standard output

Class StdIO

kermeta::io::StdIO

An implementation of StdIO : standard input/output

Package reflection

kermeta::reflection

Contains all the abstract classes used in the reflection mechanism. Implements the derived
properties
contained in the classes; declares the abstract operations.
Concrete implementation is in kermeta.language.structure.

Alias Boolean

kermeta::reflection::Boolean
Alias for kermeta::standard::Boolean

Operation new

operation new() : kermeta::reflection::Object
Undocumented

Operation toString

method toString() : kermeta::reflection::String from kermeta::reflection::Object
Undocumented

Property isAbstract

property isAbstract: kermeta::reflection::Boolean readonly
Returns true if the classDefinition of this class is abstract.

Property name

property name: kermeta::reflection::String readonly
Returns the name of the classDefinition of this class

Property ownedAttribute

property ownedAttribute: set kermeta::reflection::Property[0..*] readonly
Returns the attributes, references, and derived properties owned by
the classDefinition of this class.

Property ownedOperation

property ownedOperation: set kermeta::reflection::Operation[0..*] readonly
Returns the operations owned by the classDefinition of this class.

Property superClass

property superClass: set kermeta::reflection::Class[0..*] readonly
Returns the Classes of which the classDefinition of this class inherits.

Class Class

kermeta::reflection::Class inherits kermeta::reflection::ParameterizedType
Type corresponding to the use of a ClassDefinition (see ClassDefinition)

Property allOwnedAttribute

property allOwnedAttribute: set kermeta::reflection::Property[0..*] readonly
Returns all the attributes, references, derived properties of this
class definition including the inherited ones

Property inv

attribute inv: set kermeta::reflection::Constraint[0..*]#invOwner
Undocumented

Property isAbstract

attribute isAbstract: kermeta::reflection::Boolean
Undocumented

Property ownedAttribute

attribute ownedAttribute: set kermeta::reflection::Property[0..*]#owningClass
Returns the attributes, references, and derived properties owned by
this class definition.

Property ownedOperation

attribute ownedOperation: set kermeta::reflection::Operation[0..*]#owningClass
Returns the operations owned by this class definition.

Property superType

reference superType: set kermeta::reflection::Class[0..*]
Returns the Classes of which this class definition inherits.

Class ClassDefinition

kermeta::reflection::ClassDefinition inherits kermeta::reflection::TypeContainer, kermeta::reflection::GenericTypeDefinition
The definition of a class definition :)
class A

{
attribute s : String
}
is a class definition; in :

main() : A is do end

A is a Class : it corresponds to the use of the class definition of A

Property invOwner

reference invOwner: kermeta::reflection::ClassDefinition#~inv
Undocumented

Property postOwner

reference postOwner: kermeta::reflection::Operation#~post
Undocumented

Property preOwner

reference preOwner: kermeta::reflection::Operation#~pre
Undocumented

Class Constraint

kermeta::reflection::Constraint inherits kermeta::reflection::NamedElement
Constraint is part of a contract implementation in a Class definition or an operation.
Three kinds of constraints are available : pre, post, and inv (invariant constraint)

Class DataType

kermeta::reflection::DataType inherits kermeta::reflection::TypeDefinition, kermeta::reflection::Type
Special type definition for Enumeration, PrimitiveType

Property ownedLiteral

attribute ownedLiteral: set kermeta::reflection::EnumerationLiteral[0..*]#~enumeration
Owned item in enumeration

Class Enumeration

kermeta::reflection::Enumeration inherits kermeta::reflection::DataType
Definition for enumeration

Property enumeration

reference enumeration: kermeta::reflection::Enumeration#ownedLiteral
Undocumented

Class EnumerationLiteral

kermeta::reflection::EnumerationLiteral inherits kermeta::reflection::NamedElement
Item definition for enumeration

Property left

reference left: kermeta::reflection::Type
Undocumented

Property right

reference right: kermeta::reflection::Type
Undocumented

Class FunctionType

kermeta::reflection::FunctionType inherits kermeta::reflection::TypeContainer, kermeta::reflection::Type

Type used to define the use of lambda expressions.
Uses :
operation forAll(func : <G -> Boolean>) : Boolean is do

var test : Boolean init true
from var it : Iterator<G> init iterator
until it.isOff
loop
test := test and func(it.next)
end
result := test
end


In the above example, <G -> Boolean> is a function type f(G) ->
Boolean, with a parameter of type G and a return type of type Boolean
The operation forAll takes a lambda expression as parameter.

Property typeParameter

attribute typeParameter: set kermeta::reflection::TypeVariable[0..*]
Undocumented

Class GenericTypeDefinition

kermeta::reflection::GenericTypeDefinition inherits kermeta::reflection::TypeDefinition

Abstracts the definition of generic type definitions (i.e. type definitions that
can be parameterized), namely, for ClassDefinition and ModelTypeDefinition.

Alias Integer

kermeta::reflection::Integer
Alias for kermeta::standard::Integer

Operation add

operation add(obj : kermeta::reflection::Object) : Void
add an object to the model. According to the ModelType, the typechecker will statically verify if the object can be added or not

Operation addAllCompatible

operation addAllCompatible(objectsToAdd : kermeta::standard::Collection<kermeta::reflection::Object>) : kermeta::standard::Collection<kermeta::reflection::Object>
add all the Object of the collection that are copmpatible with the ModelDefinition. Other objects are ignored.
Returns the list of Object that have been added (One can check that some element have been ignored or not)

Operation addCompatible

operation addCompatible(objectsToAdd : kermeta::reflection::Object) : kermeta::reflection::Object
add the Object if it is copmpatible with the ModelDefinition. Other objects are ignored.
Returns the object if it has been added (One can check that some element have been ignored or not)
return Void if not added

Operation filter

operation filter(vtype : kermeta::reflection::Type) : set kermeta::reflection::Object[0..*]
returns a set of all the elements of the model that are instance of the given Type

Operation remove

operation remove(obj : kermeta::reflection::Object) : Void
remove an object from the model

Property contents

reference contents: set kermeta::reflection::Object[0..*] readonly
Contents of this model ...

Class Model

kermeta::reflection::Model inherits kermeta::reflection::Object
Is the holder of a set of model elements (Object) that are compatible with the ModelType that has
instanciated this Model.

Operation isModelTypeOf

operation isModelTypeOf(model : kermeta::reflection::Model) : kermeta::reflection::Boolean
Undocumented

Operation new

operation new() : kermeta::reflection::Model
Undocumented

Property ownedTypeDefinition

property ownedTypeDefinition: set kermeta::reflection::TypeDefinition[0..*] readonly
Undocumented

Class ModelType

kermeta::reflection::ModelType inherits kermeta::reflection::ParameterizedType
Type corresponding to the use of a ModelTypeDefinition

Class ModelTypeDefinition

kermeta::reflection::ModelTypeDefinition inherits kermeta::reflection::GenericTypeDefinition, kermeta::reflection::TypeDefinitionContainer
Definition for a model type

Class ModelTypeVariable

kermeta::reflection::ModelTypeVariable inherits kermeta::reflection::TypeVariable, kermeta::reflection::VirtualTypeContainer
See inherited classes.

Property isOrdered

attribute isOrdered: kermeta::reflection::Boolean
Undocumented

Property isUnique

attribute isUnique: kermeta::reflection::Boolean
Undocumented

Property lower

attribute lower: kermeta::reflection::Integer
Undocumented

Property upper

attribute upper: kermeta::reflection::UnlimitedNatural
Undocumented

Class MultiplicityElement

kermeta::reflection::MultiplicityElement inherits kermeta::reflection::TypedElement
Model elements with a multiplicity [lower..upper] inherit this class

Operation qualifiedName

operation qualifiedName() : kermeta::reflection::String
Returns the qualified name of this named element. Qualified name is
the list of the names of the packages hierarchically ordered, delimited by
a "::", followed by the name of this named element.

Property name

attribute name: kermeta::reflection::String[1..1]
Name of this named element

Class NamedElement

kermeta::reflection::NamedElement inherits kermeta::reflection::Object
Any element that contain a name (example : Operation, Property) inherit this
class.

Operation checkAllInvariants

operation checkAllInvariants() : Void
Undocumented

Operation checkInvariants

operation checkInvariants() : Void
Undocumented

Operation container

operation container() : kermeta::reflection::Object
Undocumented

Operation equals

operation equals(element : kermeta::reflection::Object) : kermeta::reflection::Boolean
Undocumented

Operation freeze

operation freeze() : Void
Undocumented

Operation get

operation get(~property : kermeta::reflection::Property) : kermeta::reflection::Object

Returns the instances of the given property for this Object.

Example :

class A { reference attr : String }

Using A :

operation getAProp() is do
var a : A
var s : String
var the_attr : Property init self.getMetaClass.ownedAttribute.one
s ?= a.get(the_attr)
end

The user has to cast
the result of this method according to the type and the upper multiplicity
of this property. If upper multiplicity > 1, than the effective type of the
result is a Sequence<ThePropertyName>. Otherwise, the type corresponds to
the name of the given Property (i.e the type of the property instance).

Operation getMetaClass

operation getMetaClass() : kermeta::reflection::Class
Undocumented

Operation isFrozen

operation isFrozen() : kermeta::reflection::Boolean
Undocumented

Operation isKindOf

operation isKindOf(cl : kermeta::reflection::Class) : kermeta::reflection::Boolean
Check if the current object is an instance of the given class.

Operation isNotEqual

operation isNotEqual(element : kermeta::reflection::Object) : kermeta::reflection::Boolean
Undocumented

Operation isNotSameAs

operation isNotSameAs(element : kermeta::reflection::Object) : kermeta::reflection::Boolean
Undocumented

Operation isSameAs

operation isSameAs(element : kermeta::reflection::Object) : kermeta::reflection::Boolean
isSameAs operation checks if both objects have the same id

Operation isSet

operation isSet(~property : kermeta::reflection::Property) : kermeta::reflection::Boolean
Undocumented

Operation isVoid

operation isVoid() : kermeta::reflection::Boolean
Undocumented

Operation oid

operation oid() : kermeta::reflection::Integer
Undocumented

Operation set

operation ~set(~property : kermeta::reflection::Property, element : kermeta::reflection::Object) : Void
Undocumented

Operation toString

operation toString() : kermeta::reflection::String
Returns the String representation of this class.
Note : throws an exception if this class has no classDefinition
or if the classDefinition is not well constructed.

Operation unset

operation unset(~property : kermeta::reflection::Property) : Void
Undocumented

Property tag

reference tag: set kermeta::reflection::Tag[0..*]#object
Tags are used to put comments/documentation

Class Object

kermeta::reflection::Object

Object type : all entities of Kermeta metamodel explicitely inherit Object.

Class ObjectTypeVariable

kermeta::reflection::ObjectTypeVariable inherits kermeta::reflection::TypeContainer, kermeta::reflection::TypeVariable
See inherited classes.

Property isAbstract

attribute isAbstract: kermeta::reflection::Boolean
Undocumented

Property ownedParameter

attribute ownedParameter: set kermeta::reflection::Parameter[0..*]#~operation
Undocumented

Property owningClass

reference owningClass: kermeta::reflection::ClassDefinition#ownedOperation
Undocumented

Property post

attribute post: set kermeta::reflection::Constraint[0..*]#postOwner
Undocumented

Property pre

attribute pre: set kermeta::reflection::Constraint[0..*]#preOwner
Undocumented

Property raisedException

reference raisedException: set kermeta::reflection::Type[0..*]
Undocumented

Property superOperation

reference superOperation: kermeta::reflection::Operation
Undocumented

Property typeParameter

reference typeParameter: set kermeta::reflection::TypeVariable[0..*]
Undocumented

Class Operation

kermeta::reflection::Operation inherits kermeta::reflection::MultiplicityElement
Every one knows what an operation is.

Property nestedPackage

attribute nestedPackage: set kermeta::reflection::Package[0..*]#nestingPackage
Undocumented

Property nestingPackage

reference nestingPackage: kermeta::reflection::Package#nestedPackage
Undocumented

Property uri

attribute uri: kermeta::reflection::String
Undocumented

Class Package

kermeta::reflection::Package inherits kermeta::reflection::TypeDefinitionContainer

Package in kermeta. Each kermeta model must have a root package.

Property operation

reference operation: kermeta::reflection::Operation#ownedParameter
Undocumented

Class Parameter

kermeta::reflection::Parameter inherits kermeta::reflection::MultiplicityElement
Definition for operation parameter

Property typeDefinition

reference typeDefinition: kermeta::reflection::GenericTypeDefinition[1..1]
Undocumented

Property typeParamBinding

attribute typeParamBinding: set kermeta::reflection::TypeVariableBinding[0..*]
Undocumented

Property virtualTypeBinding

attribute virtualTypeBinding: set kermeta::reflection::TypeVariableBinding[0..*]
Undocumented

Class ParameterizedType

kermeta::reflection::ParameterizedType inherits kermeta::reflection::Type
Abstraction for Parameterized types, namely, Class and ModelType

Property instanceType

reference instanceType: kermeta::reflection::Type
Undocumented

Class PrimitiveType

kermeta::reflection::PrimitiveType inherits kermeta::reflection::TypeContainer, kermeta::reflection::DataType
The class definition for kermeta aliases. Above statement defines a primitive
type called MyString, which instanceType is kermeta::standard::String
alias MyString : kermeta::standard::String

Property type

reference type: set kermeta::reflection::Type[1..*]
Undocumented

Class ProductType

kermeta::reflection::ProductType inherits kermeta::reflection::TypeContainer, kermeta::reflection::Type
See inherited classes.

Property default

attribute default: kermeta::reflection::String
Undocumented

Property isComposite

attribute isComposite: kermeta::reflection::Boolean
Undocumented

Property isDerived

attribute isDerived: kermeta::reflection::Boolean
Undocumented

Property isID

attribute isID: kermeta::reflection::Boolean
Undocumented

Property isReadOnly

attribute isReadOnly: kermeta::reflection::Boolean
Undocumented

Property opposite

reference opposite: kermeta::reflection::Property
Undocumented

Property owningClass

reference owningClass: kermeta::reflection::ClassDefinition#ownedAttribute
Undocumented

Class Property

kermeta::reflection::Property inherits kermeta::reflection::MultiplicityElement
Class representing the property definition. Kermeta<->Ecore equivalence:
- Property with isComposite == true or with type is a base type (String, Integer, Boolean) : EAttribute
- Property with isComposite == false : EReference

Class SelfType

kermeta::reflection::SelfType inherits kermeta::reflection::Type

Self type : DEPRECATED

Alias String

kermeta::reflection::String
Undocumented

Property name

attribute name: kermeta::reflection::String
Undocumented

Property object

reference object: set kermeta::reflection::Object[1..*]#tag
Undocumented

Property value

attribute value: kermeta::reflection::String
Undocumented

Class Tag

kermeta::reflection::Tag inherits kermeta::reflection::Object
Tag is intended to be used to add documentation on a
model element, or add some textual information that cannot be expressed
with any model element definition.

Operation isInstance

operation isInstance(element : kermeta::reflection::Object) : kermeta::reflection::Boolean
Undocumented

Operation isSubType

operation isSubType(element : kermeta::reflection::Type) : kermeta::reflection::Boolean
Undocumented

Property typeContainer

reference typeContainer: kermeta::reflection::TypeContainer[1..1]#containedType
Undocumented

Class Type

kermeta::reflection::Type inherits kermeta::reflection::Object
Base class definition for the use of a type.

Property containedType

attribute containedType: set kermeta::reflection::Type[0..*]#typeContainer
Undocumented

Class TypeContainer

kermeta::reflection::TypeContainer inherits kermeta::reflection::Object
Phantom class : EMF reflexive editors need that any element of a metamodel
has a direct or indirect containment relationship with the root model element of
the metamodel. This class resolves this technical requirement.

Class TypeDefinition

kermeta::reflection::TypeDefinition inherits kermeta::reflection::NamedElement

Abstraction for type definitions (ClassDefinition, ModelTypeDefinition, DataType inherit
this class)

Property ownedTypeDefinition

attribute ownedTypeDefinition: set kermeta::reflection::TypeDefinition[0..*]
Undocumented

Class TypeDefinitionContainer

kermeta::reflection::TypeDefinitionContainer inherits kermeta::reflection::NamedElement

Abstraction of the notion of containment for type definitions. Now, kermeta metamodel contains one container
element, that is Package. In a later release, ModelTypeDefinition will be the main container for type and
package definition.

Property supertype

reference supertype: kermeta::reflection::Type
Undocumented

Class TypeVariable

kermeta::reflection::TypeVariable inherits kermeta::reflection::TypeContainer, kermeta::reflection::Type, kermeta::reflection::NamedElement
Definition of a type variable for generic types :
in class definition
class AClass<X,Y> {}
, X and Y are type variables.

Property type

reference type: kermeta::reflection::Type[1..1]
Undocumented

Property variable

reference variable: kermeta::reflection::TypeVariable[1..1]
Undocumented

Class TypeVariableBinding

kermeta::reflection::TypeVariableBinding inherits kermeta::reflection::TypeContainer, kermeta::reflection::Object
See inherited classes.

Property type

reference type: kermeta::reflection::Type
The type of this model element

Class TypedElement

kermeta::reflection::TypedElement inherits kermeta::reflection::TypeContainer, kermeta::reflection::NamedElement
Abstraction of the notion of typed element : each element
that is typed inherits this class.

Alias UnlimitedNatural

kermeta::reflection::UnlimitedNatural
Alias for kermeta::standard::UnlimitedNatural

Property classDefinition

reference classDefinition: kermeta::reflection::ClassDefinition[1..1]
Undocumented

Property modelType

reference modelType: kermeta::reflection::VirtualTypeContainer[1..1]#virtualType
Undocumented

Property typeParamBinding

reference typeParamBinding: kermeta::reflection::TypeVariableBinding[0..*]
Undocumented

Class VirtualType

kermeta::reflection::VirtualType inherits kermeta::reflection::ObjectTypeVariable
See inherited classes.

Property virtualType

attribute virtualType: set kermeta::reflection::VirtualType[0..*]#modelType
Undocumented

Class VirtualTypeContainer

kermeta::reflection::VirtualTypeContainer inherits kermeta::reflection::Object
See inherited classes.

Class VoidType

kermeta::reflection::VoidType inherits kermeta::reflection::Type
Class definition for the
Void
type

Package utils

kermeta::utils

Contains special classes (Hashtable, Stack) that are not contained in Kermeta
metamodel

Operation clear

operation clear() : Void

Remove all elements from the Hashtable

Operation containsKey

operation containsKey(key : K) : kermeta::standard::Boolean
Tests if a key is present in the table

Operation getValue

operation getValue(key : K) : V

returns the value for key 'key'

Operation keyIterator

operation keyIterator() : kermeta::standard::Iterator<K>

returns an iterator on the keys of the map

Operation keys

operation keys() : kermeta::standard::Set<K>
Return the keys of the Hashtable

Operation put

operation put(key : K, ~value : V) : Void

Adds a entry in the Hashtable

Operation remove

operation remove(key : K) : Void

Removes the entry which key equals 'key'

Operation size

operation size() : kermeta::standard::Integer

returns size of the map

Operation valueIterator

operation valueIterator() : kermeta::standard::Iterator<V>

returns an iterator on the keys of the map

Operation values

operation values() : kermeta::standard::Collection<V>
Return the keys of the Hashtable

Class Hashtable

kermeta::utils::Hashtable<K, V>

An implementation of hashtable

Operation peek

operation peek() : G

Get the element at the top of the stack

Operation pop

operation pop() : G

Get the element at the top of the stack and
removes it from the stack

Operation push

operation push(element : G) : Void

Push an element in the stack

Class Stack

kermeta::utils::Stack<G> inherits kermeta::standard::Sequence<G>

An implementation of stack

Package standard

kermeta::standard

Contains Collections and primitive types, i.e the base types like String,
Integer, etc.

$Id: java.kmt,v 1.1 2006/10/04 11:12:43 dvojtise Exp $
Contains types dedicated to dealing with java objects

Operation asSet

operation asSet() : kermeta::standard::Set<G>
Undocumented

Operation equals

method equals(element : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::reflection::Object
Undocumented

Operation intersection

operation intersection(elements : kermeta::standard::Bag<G>) : kermeta::standard::Bag<G>
returns the intersection of elements and the Bag

Operation intersectionWithSet

operation intersectionWithSet(elements : kermeta::standard::Set<G>) : kermeta::standard::Set<G>
returns the intersection of a set of elements and the Bag

Operation union

operation union(elements : kermeta::standard::Collection<G>) : kermeta::standard::Bag<G>
returns the union of elements and the Bag

Class Bag

kermeta::standard::Bag<G> inherits kermeta::standard::Collection<G>

A Bag is a concrete implementation of a Collection

Operation and

operation ~and(other : kermeta::standard::Boolean) : kermeta::standard::Boolean
Undocumented

Operation equals

method equals(other : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::reflection::Object
Undocumented

Operation implies

operation implies(other : kermeta::standard::Boolean) : kermeta::standard::Boolean
Undocumented

Operation isNotSameAs

method isNotSameAs(element : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::standard::PrimitiveType
Undocumented

Operation isSameAs

method isSameAs(element : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::standard::PrimitiveType
Undocumented

Operation nand

operation nand(other : kermeta::standard::Boolean) : kermeta::standard::Boolean
Undocumented

Operation not

operation ~not() : kermeta::standard::Boolean
Undocumented

Operation or

operation ~or(other : kermeta::standard::Boolean) : kermeta::standard::Boolean
Undocumented

Operation toString

method toString() : kermeta::standard::String from kermeta::reflection::Object
Undocumented

Operation xor

operation xor(other : kermeta::standard::Boolean) : kermeta::standard::Boolean
Undocumented

Class Boolean

kermeta::standard::Boolean inherits kermeta::standard::PrimitiveType

The Boolean type

Operation compareTo

method compareTo(other : kermeta::standard::Object) : kermeta::standard::Integer from kermeta::standard::Comparable
Undocumented

Operation equals

method equals(other : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::reflection::Object
Undocumented

Operation isNotSameAs

method isNotSameAs(element : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::standard::PrimitiveType
Undocumented

Operation isSameAs

method isSameAs(element : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::standard::PrimitiveType
Undocumented

Operation toString

method toString() : kermeta::standard::String from kermeta::reflection::Object
Undocumented

Class Character

kermeta::standard::Character inherits kermeta::standard::ValueType, kermeta::standard::Comparable

The class Character

Operation add