Kermeta API Documentation |
Generation date: Apr 12, 2012 |
API : kermeta
• kermeta::kunit
• kermeta::language
• kermeta::language::structure
• kermeta::language::behavior
• kermeta::standard
• kermeta::utils
• kermeta::xmltype
• kermeta::persistence
• kermeta::exceptions
• kermeta::io
• kermeta::interpreter
• kermeta::ecore
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.
main features of the famous Unit test tool for Kermeta language
process the given condition and react with the given message
if it is satisfied
Log a failure if the two strings are not identical modulo-white-space
process the given condition and react with the given message
if it is not satisfied
process the given condition and react with the given message
if it is not satisfied
* reduces all runs of white-space to a single space character
to be written ############################
@
Sets up a new error with failable object and the exception that occurred
by default it will be a test error. Use makeSetUp or makeTearDown to
change its type
Changes the type of an error to SetUpError, the best way to use
this method is to call it after the init from line:
var e : Error init Error.new.initFrom(f, e).makeSetUp
Changes the type of an error to makeTearDownError, the best way to use
this method is to call it after the init from line:
var e : Error init Error.new.initFrom(f, e).makeTearDown
overwrite the default method, in order to add :
- the type
- the message
- the stack trace
the Kermeta exception corresponding to the error
the nature of the stored error
Error represents an occurrence of an exception in setUp, tearDown or a test
and is stored in a failure log
@
initialization of the failure
overwrite the default method, in order to add the message
the stored message (given or generated one)
Failure represents an assertion failure stored in a failure log
@
Log a failure if condition is false
Log a failure if the two strings are not identical
Log a failure if condition is true
Log a failure if condition is true
Log a failure if condition is false
Log a failure if condition is false
Log a failure if condition is false
Log a failure
current order position of counter of assertions
Set this attribute to false if you wish your test to not stop if the assert fails.
note : if set to false, the count of failures/errors may be bigger that the number of executed test operations
This is represents the aspect of tests that they may go wrong.
it defines the ability to define the conditions for success
(assertions) and the mechanism for recording that those
conditions have not been met.
@
This is for when we try to build a suite from a class that isn't a TestCase
@
This exception is rose if there is a problem on the name of the test method
@
Adds a failed test to the list of failed tests
Adds errors which occur during the SetUp phase
Adds errors which occur during the TearDown phase
Adds an error to the list of errors
Increments the runtests counter
list of detected assertion failures
list of detected errors with the test harness
Log is a log of failures and errors that happened to fallibles since start was called
@
Execute the test and verify its assertions
Initializes the log where failures and errors will be put
The abstact notion of a test which is runnable and which has a log
in which it can keep note of failures
@
accessor on the log
accessor on the method name
operation used when the TestCase is run from a java test runner, encapsulates the failures results
into an AssertionFailedError so the TestRunner can detect it
Execute the whole test case : SetUp, test method, TearDown
The assertions of the test method are computed
Sets the name of the method from the concrete subclass of
TestCase that should be executed when this TestCase instance
is run as a test.
Throws invalidTestCaseNameException if the given string is not
the name of a method in the test case
the things to be done before execution of the test method
(designed to be overwritten in real TestCase classes)
the things to be done after execution of the test method
(designed to be overwritten in real TestCase classes)
overwrites the default method for more informative output
the name of the method which corresponds to the test case in the test class
A test case comprises one or more test methods plus
setUp and tearDown that build and destroy their test harness.
An instance of a subclass of TestCase should have its
testMethodName set to the name of one of its operations
which should be called whe the test is run. You can do this
yourself:
var testCase : TestCase init MyTestCaseClass.new.setTestMethodName("testSomething")
Alternatively if your TestCase Class has many methods whose
name begins with 'test' you can create a set of instaces already
set up with their testMethodName using the addAllTestCasesFrom
operation on TestSuite
@
Prints the log or errors and failures from a test run.
Run some tests first.
For backwards compatibility with old kunit, this takes a test case class
and creates the necessary suite, and runs it. DEPRECATED
Use this to run a test case or a test suite.
If you want to run all the test.... methods in a TestCase class,
you can populate a suite with TestSuite.addAllTestCasesFrom
Create and use a test runner to run one or more tests and print the failure log. E.g.:
do
var suite : TestSuite init TestSuite.new.addAllTestCasesFrom(InterestingTestCaseSet)
var runner : TestRunner init TestRunner.new
runner.run(suite)
runner.printLogs
end
Where InterestingTestCaseSet is a subclass of TestCase and contains several test... methods
@
Add to this suite, a set of test cases of type c, one for each
test method in class c. C must be a descendent of TestCase
to be written #####################################################
Run all the tests in the test suite
The collection of tests which will be ran as the suite
A TestSuite is a structured collection of tests, using the
composite pattern, all tests are runnable and have a log
In addition a suite can be populated automatically from a
test case class with one test case object for each test
method in the class.
You can make a suite and populate it manually like this:
var suite : TestSuite init TestSuite.new.
suite.tests.add(t1)
Alternatively you can populate a suite automatically from
a class that inherits TestCase and which has several methods
called test:
var suite : TestSuite init TestSuite.new.addAllTestCasesFrom(InterestingTestCaseSet)
@
Overrides kermeta::standard::Set<G>.add(G)
Add an element to this collection and update its opposite property if it exists.
Overrides kermeta::standard::Collection<G>.clear(G)
Overrides kermeta::standard::Set<G>.remove(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.
@
Overrides kermeta::language::ReflectiveCollection<G>.add(G)
Overrides kermeta::standard::OrderedSet.addAt(Integer)
Overrides kermeta::language::ReflectiveCollection<G>.clear()
Overrides kermeta::standard::OrderedSet.equals(Object)
Overrides kermeta::language::ReflectiveCollection<G>.remove(G)
Overrides kermeta::standard::OrderedSet.removeAt(Integer)
ReflectiveSequence is an ordered ReflectiveCollection.
@
Instantiates a new occurence for this Class
@
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.
Returns the ClassDefinition for this class
Returns all the types directly and indirectly inherited by this ClasDefinition
returns a cached version of the derived property allAttribute
It is intended to be used to optimize access on the reflexivity,
do not use this cache if you are modifying the ClassDefinition
returns a cached version of the derived property allSuperTypes
It is intended to be used to optimize access on the reflexivity,
do not use this cache if you are modifying the ClassDefinition
Data structure for getCachedAllAttribute
Data structure for getCachedAllSuperTypes
Returns all the Attributes, References, derived Properties of this
ClassDefinition including the inherited ones
Returns all the Operations of this ClassDefinition
including the inherited ones
Implements kermeta::language::structure::Type.clone(Object)
@
Add an object to the model. According to the ModelType, the typechecker will statically verify if the object can be added or not
@
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)
@
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
@
Returns a set of all the elements of the model that are instance of the given Type
@
Remove an object from the model
@
To be written ##########################################
@
To be written ##########################################
@
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.
Implementation of OCL like cast. It returns self if the object object conforms to the type given as parameter.
@
Recursively runs checking of invariants defined for the metaclass of the Object
and its supertypes
Ignores derived attributes.
@
Checks a constraint invariant defined for the metaclass of the Object
You can use PropertyConstraint for checking structural constraints associated to a property
@
Runs checking of invariants defined for the metaclass of the Object
Also check the multiplicity of attributes (except derived and transient attributes)
@
Returns the Object that contains current Object, void if the Object has
no container
@
Returns the Resource currently containing (directly or indirectly) the Object
or void if the object belongs to no Resource
@
semantic equality,
if you wish to test for object identity you need to use the method oid
ex: x.oid == y.oid
by default, (ie. if not overloaded), the equals method for class Object implements
the most discriminating possible equivalence relation on objects; that is, for any non-null
reference values x and y, this method returns true if and only if x and y refer to the same
object (x.oid == y.oid has the value true).
note1: the operator == is mapped to this
note2: overloading this operation have some impact on the behavior on collection and hashtable that rely on it
@
Freeze the Object
@
Returns the instances of the given property for this Object.
Example :
Using A :
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).
@
Returns the Class object that is the metaclass of current Object
@
Checks all the invariants for this object and return a complete diagnostic.
This also includes the structural constraints associated to the properties.
@
code used in hashtable in order to identify an object in the hashtable keys
This system is similar to the hashcode used in java. Please refer to java documentation
for more information about hashcode
@
Returns a Boolean stating whether the Object is currently in a
frozen state
@
Returns a Boolean stating whether the current Object conforms to given Type
This means: is this object an instance of this type, or is it an instance of its subtype
@
Returns a Boolean stating whether the current Object is an instance of the given Class
See kermeta::language::structure::Object.equals(Object)
@
True if the
@
Returns a Boolean stating whether the Object is Void
@
Returns the unique Oid of the Object
@
Sets the
@
Implements Object.toString()
Returns a String of form [qn:oid] where 'qn' is the qualified name of
the object type, and oid the unique ID of the object
@
Remove the element set as the
The
@
The property that is checked by this constraint
Typically, it will check the lower and upper bounds
Returns a copy of passed Object built by recursively copying attribute
properties, and referencing original reference properties values
@
Returns a copy of passed Object built by recursively copying values of
all properties, no matter the property kind
@
Implements Type.isInstance(Object)
@
Implements Type.isSubTypeOf(Type)
For technical reason, the current implementation works only with Type that comes from a kermeta declaration (ie. in a require)
it won't work with Type created programmaticaly by the user. If you need that, please ask to the kermeta developpers
to extend it.
@
Implements Type.isSuperTypeOf(Type)
For technical reason, the current implementation works only with Type that comes from a kermeta declaration (ie. in a require)
it won't work with Type created programmaticaly by the user. If you need that, please ask to the kermeta developpers
to extend it.
@
Defines value types
Defines Collection types
Contains types dedicated to dealing with java objects
Overrides Collection<G>.asBag()
Returns a new Bag containing all elements of current Bag
Overrides Collection<G>.asOrderedSet()
Returns a new OrderedSet containing elements of the Bag without duplicates
Overrides Collection<G>.asSequence()
Returns a new Sequence containing all elements of current Bag
Overrides Collection<G>.asSet()
Returns a new Set containing elements of the Bag without duplicates
Returns a sequence of the bag elements sorted using the given comparator.
The comparator must return :<ul>
<li>+1 if the second <G> element is greater than the first</li>
<li>0 if the second <G> element equals the first</li>
<li>-1 if the second <G> element is lower than the first</li>
Recursive sort of the given sequence using the given comparator.
The comparator must return :<ul>
<li>+1 if the second <G> element is greater than the first</li>
<li>0 if the second <G> element equals the first</li>
<li>-1 if the second <G> element is lower than the first</li>
Internal concatenation tool for recursive 'quickSort()' method
Overrides Object.equals(elt : Object)
Returns a Boolean stating whether the provided element is equal to
current Bag
Returns a new Bag which content includes the content of the
current Bag from which all instances of object have been
removed
Returns a new Bag which content includes all non-Collection elements
of the current Set, and, for each Collection element of the current
Bag, as many elements as the Collection contains
Returns a new Bag which content includes the content of the
current Bag and the element object
Returns a new Bag corresponding to the intersection of elements
and the Bag
Returns a new Set corresponding to the intersection of a Set of
elements and the Bag
Removes the element identified by the provided Oid from the Bag
Removes one instance of element from the Bag
Returns a new Bag corresponding to the union of elements and
current Bag
Bag is a concrete non-ordered Collection allowing duplicates
@
return self and other
Short-circuit version of AND. This means that the function passed in parameter will be evaluated only if self is true
Note: we don't have a dedicated operator in the syntax for it yet so here is an example of use :
self.andThen{v | functionThatReturnABoolean() }
Returns true if
and has the same boolean value than current object.
return self implies other
http://en.wikipedia.org/wiki/Material_implication
meaning : (not self) or other
return self nand other
return self or other
Short-circuit version of OR. This means that the function passed in parameter will be evaluated only if self is false
Note: we don't have a dedicated operator in the syntax for it yet so here is an example of use :
self.orElse{v | functionThatReturnABoolean() }
Returns 'true' or 'false', depending on self value
return self xor other
Comparaison
Returns true if
and has the same letter value than current object.
Conversion from Character to String
The class Character
@
Adds an element in the Collection (default implementation)
Adds all elements from the Collection elements in the current Collection
Returns an element from the Collection
Raises an EmptyCollection exception if the Collection is empty
Returns a new Bag built from the Collection
Returns a new OrderedSet built from the Collection
Returns a new Sequence built from the Collection
Returns a new Set built from the Collection
Removes all elements from the Collection
Returns a new Sequence which content corresponds to the result
of running the collector function for each element of the Collection
The new collection size is the same as in the original collection, and which element types is the type of the result of the expression.
example :
aCollection2 := aCollection.collect { e | \/* put here an expression, for example e.name *\/ }
Returns a Boolean stating whether the Collection contains at least one
instance of element, based on G.equals(elt : Object) definition
Note: for checking whether a physical element is contained by the collection,
make use of G.oid()
Returns true if current Collection contains all elements of Collection elements
See Collection<G>.contains(Object)
Returns the number of instances of element in the Collection
Returns an element of the Collection (usually the first) for which the detector function
is not false
Returns void if no elements is validated by the detector function
example :
anObject := aCollection.detect { e | \/* a condition *\/} // returns an element that fulfill the condition.
Runs function func on each element of the Collection
example :
aCollection.each { e | \/* do something with each element e of this collection *\/ }
Returns a Boolean stating whether the Collection is empty
Returns true if the Collection does not contain element
Returns true if the Collection contains no element of Collection elements
Returns a Boolean stating whether at least one element of the Collection
validates the condition specified by function func
example :
aBoolean := aCollection.exists { e | \/* a condition *\/} // returns true if at least one element fulfill the condition.
Combinaison of exists on two elements in the collection
=> result := self.exists{x | self.exists {y | f(x,y)}}
Returns a Boolean stating whether no element of the Collection invalidates
the condition specified by function func
example :
aBoolean := aCollection.forAll { e | \/* put here a condition *\/ } // return true if the condition is true for all elements in the collection.
Combinaison of ForAll on two elements in the collection
result := self.forAll{x | self.forAll {y | f(x,y)}}
(where x and y are 2 elements of the Collection)
typical use sample : ownedState.forAll{s1,s2| (s1.name==s2.name)implies(s1==s2)}
OCL API alignment, doeas the same as contains
See Collection<G>.contains(Object)
OCL API alignment, does the same as containsAll
See Collection<G>.containsAll(Collection<G>)
Runs function func on each element of the Collection
the eachContext contains some information about the each process that can be used in the function,
for example the index represents the rank in the collection, start on 0
or boolean to indicates weither we are processing the first and/or the last element of the collection
note that this rank is relative to the processing order. this processing order is ensured only for sequence and ordered set
example :
aCollection.indexedEach { e, eachContext | \/* do something with each element e of this collection *\/ }
OCL alignment API, does the same as empty
See Collection<G>.empty()
OCL alignment API
Returns a Boolean stating whether the Collection contains at least
one element
See also Collection<G>.contains(Object)
Returns a Boolean stating whether the the collector function evaluates to a
different value for each element of the Collection
example :
aCollection2 := aCollection.isUnique { e | \/* put here an expression that must be unique for all elements, for example e.name *\/ }
Returns an Iterator on the Collection
Returns an element from the Collection or void if the Collection is empty
Returns a new Sequence composed of elements of the Collection that
do not validate the rejector function
example :
aCollection2 := aCollection.reject { e |
\/* put here a condition that returns true for elements that must be exclude in the resulting Collection *\/
}
Removes all instances of element from the Collection, based on
G.equals(Object) definition
Returns a new Sequence composed of elements of the Collection that
validate the selector function
example :
aCollection2 := aCollection.select { e |
\/* put here a condition that returns true for elements that must be included in the resulting Collection *\/
}
Returns the number of elements in the Collection
Sum the element if they are summable (ie implement '+' operator by inheriting of the class Summable)
Collection is the root abstract class for all kermeta collections
@
This method should be implemented by any class that inherits
from Comparable.
returns 0 if self = other
returns > 0 if self > other
returns < 0 if self < other
return true if self > other
return true if self >= other
return true if self < other
return true if self <= other
The abstract class Comparable defines a set of operation
to compare instances of a class.
Sub-classes only has to implement abstract operation compareTo.
All other methods are defined w.r.t. the compareTo operation
@
context used in the indexedEach of Collection
@
Comparison
returns self / other
Returns true if
and has the same numeric value than current object.
return true if self > other
return true if self >= other
return true if self < other
return true if self <= other
returns self - other
returns self modulo other
returns self * other
returns self + other
Iteration
Numeric value in string format
The class Integer
@
Returns true if the iterator has a next element
Returns true if the iterator is on the last element
i.e. returns not self.hasNext()
Returns the next element of the iterator
Raises IteratorIsOff exception in case the iterator is on the last element
Iterator to be used with Collection
See also Collection<G>.getIterator()
@
raised when two objects are not comparable
@
The abstract class Numeric is the root class for all
numeric types
@
Adds element in the OrderedCollection at rank index
Raises IndexOutOfBound exception if provided index is lower than 0 or
larger than the size of the OrderedCollection
Returns the element at rank index in the OrderedCollection
Raises IndexOutOfBound exception if provided index is lower than 0 or
larger than the size of the OrderedCollection
Overrides Object.equals(Object)
Returns a Boolean stating whether the provided element is equal to
current OrderedCollection
Returns the first element in the OrderedCollection
Raises an EmptyCollection exception if the OrderedCollection is empty
Returns the index of the first instance of element in the OrderedCollection
or -1 if the element is not contained by the OrderedCollection
Raises an EmptyCollection exception if the OrderedCollection is empty
Returns the last element in the OrderedCollection
Raises an EmptyCollection exception if the OrderedCollection is empty
Removes the element at rank index from the OrderedCollection
Raises IndexOutOfBound exception if provided index is lower than 0 or
larger than the size of the OrderedCollection
An OrderedCollection is the root abstract class for all ordered Collections.
@
See Set<G>.add(G)
Overrides OrderedCollection<G>.addAt(Integer, G)
Adds element in the OrderedSet at rank index if the ordered set does
not already contain the element, does nothing otherwise
Builds and returns a new OrderedSet from current one with element
inserted in head
Returns element at rank index in the sequence
Raises IndexOutOfBound exception if provided index is lower than 0 or
larger than the size of the OrderedSet
See OrderedCollection<G>.equals(Object)
Builds and returns a new OrderedSet from current one with element
inserted at rank index
Builds and returns a new OrderedSet from current one with element
inserted in tail
Builds and returns a new OrderedSet composed of elements of current ordered
set from rank min to rank max (order is respected)
Raises IndexOutOfBound exception if min is negative, max is larger than
the size of the ordered set or min is larger than max
An OrderedSet is a Set that contained ordered distinct elements
@
Comparison
returns self / other
Returns true if
and has the same numeric value than current object.
returns self - other
returns self * other
returns self + other
Returns numeric value in string format
class Real
@
Builds and returns a new Sequence from current one with element
inserted in head
Returns element at rank index in the sequence
Raises IndexOutOfBound exception if provided index is lower than 0 or
larger than the size of the Sequence
Overrides OrderedCollection<G>.equals(Object)
Returns a Boolean stating whether the provided element is equal to
current Sequence
Builds and returns a new Sequence from current one with element
inserted at rank index
Builds and returns a new Sequence from current one with element
inserted in tail
Builds and returns a new Sequence composed of elements of current sequence
from rank min to rank max (order is respected)
Raises IndexOutOfBound exception if min is negative, max is larger than
the size of the sequence or min is larger than max
A Sequence is an OrderedCollection of elements allowing duplicates
@
Overrides Collection<G>.add(G)
Adds elt to the Set if it is not already contained by the
Set, does nothing otherwise
Overrides Collection<G>.asBag()
Returns a new Bag composed of all elements of current Set
Overrides Collection<G>.asOrderedSet()
Returns a new OrderedSet that contains all elements of current Set
Overrides Collection<G>.asSequence()
Returns a new Sequence composed of all elements of current Set
Overrides Collection<G>.asSet()
Returns a new Set composed of all elements of current Set
Returns a ordered set of the bag elements sorted using the given comparator.
The comparator must return :<ul>
<li>+1 if the second <G> element is greater than the first</li>
<li>0 if the second <G> element equals the first</li>
<li>-1 if the second <G> element is lower than the first</li>
Recursive sort of the given (ordered) set using the given comparator.
The comparator must return :<ul>
<li>+1 if the second <G> element is greater than the first</li>
<li>0 if the second <G> element equals the first</li>
<li>-1 if the second <G> element is lower than the first</li>
Internal concatenation tool for recursive 'quickSort()' method
Overrides Object.equals(Object)
Returns a Boolean stating whether the provided element is equal to
current Set
Returns a new Set which content includes all non-Collection elements
of the current Set, and, for each Collection element of the current
Set, as many elements as the Collection contains
Duplicates are removed
Returns a new Set corresponding to the intersection of the Set elements
with the current Set
Returns a new Set corresponding to the difference between the
current Set and the Set elements, ie all elements contained by
the current Set that do not appear in the elements Set
Overrides Collection<G>.remove(G)
Removes the element from the Set if it is contained by the Set
Returns a new Set which contents corresponds to the symmetric
difference between current Set and Set s, ie all elements of
each Set that do not appear in the other one
Returns a new Set corresponding to the union of the Set elements
with the current Set
Returns a new Bag corresponding to the union of the Bag elements
with the current Set
A Set is a non-ordered collection that contains distinct elements
(with regards to the G.equals(Object) operation)
@
Appends other at the end of self
A more efficient method is kermeta::utils::StringBuffer::append(other)
Comparaison
Return if a string is contained by another string
returns the character at index in the String
Returns true if
and has the same string value than current object.
returns the index within this string of the first
occurrence of the specified substring
returns a new string self + other
Replaces all occurences of str1 in the current string by the string str2
returns the number of characters in the current String
Return of an ordered set of the splitted string
Note that the delimiter is a regular expression (as the split operation in java)
returns a new string that is a substring of this string
takes as parameters : the startIndex and endIndex
Parses the current string and returns true if the string is "true" and false if the string is "false"
The parsing is not case sensitive and if no boolean value is recognized then a StringFormatException is raised.
Parses the current string into an integer.
if no integer value is recognized then a StringFormatException is raised.
Return the current string in lower case
Parses the current string into a real.
if no real value is recognized then a StringFormatException is raised.
returns the string itself
Return the current string in upper case
The class String
@
Summarization method to be implemented by any summable class.
The parameter must have the same type (or one of its subtypes)
than the current object .
The abstract class Summable defines a set of operation
to sum instances of a class.
Sub-classes only has to implement abstract operation plus.
@
NOT IMPLEMENTED
This special object is used to represent java objects that cannot be concretely used with kermeta
the only actions possible on these objects are : assignment and passing them as parameter
@
Unlimited natural is used for reflection.
It is mapped to integer.equals().
Any negative number is interpreted as '*'
@
The abstract class ValueType does not contain any feature.
However, any instance of a sub-class of ValueType will be passed by value
instead of by reference for any other objects.
that means that each time you := such object it will call the clone function associated to it (Not implemented yet except for Integer, String and boolean!!!)
@
Returns true
Return true
Returns the String identifier '<void>'
The class Void
By convention it is a sub-type of everything
@
Contains special classes (Hashtable, Stack) that are not contained in Kermeta
metamodel
Contains special classes (Hashtable, Stack) that are not contained in Kermeta
metamodel
Removes all elements from the Hashtable
Returns a Boolean stating whether a key is present or not in this Hashtable
Returns the value for key 'key' if it exists, otherwise returns Void
Returns an iterator over the Keys of this Hashtable
Returns a set containing the hash keys of this Hashtable
Adds a entry into the Hashtable
Removes the entry with key equals to 'key'
Returns an iterator over the values of this Hashtable
Returns a collection containing the elements of this Hashtable
An implementation of hashtable
This implementation is for speed optimisation it cannot be serialized.
If your wish to serialize its content you need to copy its content into a classical ecore structure (attribute or references)
@
Gets the element at the top of the stack
Get and remove the element at the top of the stack
Pushes an element into the stack
An implementation of stack
@
Append a given string at the end of this StringBuffer
@param arg0 A string to append at the end of this StringBuffer
@return A reference to this object
Return the length of the StringBuffer
@return length of the StringBuffer
Convert this StringBuffer to String and return its value
@return The string value of this StringBuffer
This class mimic the behavior of the java's StringBuffer class. This enables better performance in long
string concatenation.<br>
Only work on Strings
@
Contains the definition of a Kermeta classes used for compatibility with XMLType.ecore
Kermeta representation of EMF type::QName from XMLType.ecore
@
Contains the classes that handle the serialization of models, in particular
EMF models.
user friendly message build with those informations
Element that is not contained by a resource in the repository
Element that has a reference to the dangling element
Property used to reference the dangling element
class used to gather the information required to make a user friendly report about a dangling element
(see. findDanglingModelElements())
@
Overrides Repository.createResource(String, String)
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
Register the content of the given ecore file into EMF registry
Once registered, EMF will be able to load and save models conformant to this ecore file
Warning: if the NSURI you wish to register is already, registered (either statically or due to a previous call)
it will do nothing. Ie. modification in the ecore file will not be taken into account unless you manually unregister it.
When loading the Resources,
if there are some errors while loading some objects, the loader can try to ignore them
setting this attribute to true is equivalent to setting ignoreLoadErrorUnknownMetaclass and ignoreLoadErrorUnknownProperty to true
by default, not setting this attribute is considered as false.
When loading the Resources,
if there are some errors due to an unknown metaclass while loading some objects, the loader try to ignore them
by default, not setting this attribute is considered as false.
When loading the Resources,
if there are some errors due to an unknown property while loading some objects (ie. the metaclass is known but it cannot retreive
the given reference or attribute in the ClassDefinition, the loader try to ignore them
by default, not setting this attribute is considered as false.
If true, tells to the save of the resources that they should also integrate the resources from Kermeta interpreter itself
this is useful for example to make a dependency to framework.km
by default, not setting this is considered as false.
Repository that stores and manages resources that come from EMF
@
Overrides Set<Object>.add(Object)
Add an instance to the Resource
Ensures that the instance is referenced by a one and only one Resource of the same Repository
Ensures that the instance does not appear more than once in the Resource
Overrides Resource.load()
In case the metamodelURI was not previously set, metamodelURI is filled with
the nsuri of the root package of the metamodel used to load the Resource after
a successful load
Overrides Set<Object>.remove(Object)
Remove the instance from the Resource
Overrides Resource.save()
Checks the Resource using the EMF validation function, and saves it if
validation succeeds
Applies validation to all root objects of the Resource
Returns true if the validation reports no error, raises exceptions otherwise
Overrides Resource.saveWithNewURI(String)
Creates a new Resource with given uri, and an optional mm_uri
mm_uri is required when creating a new model from scratch.
Raises a ResourceCreate exception in case the Repository already
contains a Resource with the given uri
If uri does not points to an existing model file (in the case of
a model creation), calls to load() operation will fail as long as
the model has not been saved once
Search for elements referenced by one element contained by this repository that are not contained by this repository
ie. element that EMF would claim as "not contained in a resource"
example of use :
var report : Set<DanglingDiagnostic>
report := repository.findDanglingModelElements()
report.each{ diag | stdio.writeln(diag.toString ) }
Returns the Resource associated with the given uri if this uri is associated with
an already created Resource of the Repository.
If the Repository contains no Resource associated with the given uri, creates
a new Resource and loads it.
In order to prevent multiple load of the same file by using variant path to the same file, all URI used by this function are normalized
Raises a ResourceCreate exception if the given uri does not point to an existing
model file
May also raises loading exceptions if this is the first retrieval of the resource
Return a normalized version of the Uri
in order to prevent several loading of the same file because they have different path that leads to them, kermeta uses normalizedURI
for some of its functions (eg. repository.getResource )
As EMF needs URI of the form platform:/resource or platform:/plugin, kermeta automatically
normalize the uri when loading or saving. This is especially true for file:/ uri or relative uri (./ or / )
If you wish to know what concrete uri is used by kermeta when loading and saving you can use this function
to check how a given uri is normalized by kermeta
Resources created by this Repository
This feature is supposed read only, otherwise it cannot garantee that an element is contained by only
one Resource of a given Repository
Abstract resource container, that contains a list of available loaded resources,
and methods to create or get a resource given an URI.
A repository cannot contain 2 resources which points to the same file (ie. that have the same normalizedURI)
@
Search for elements referenced by one element contained by this resource that are not contained by this repository
ie. element that EMF would claim as "not contained in a resource"
checks only objects directly referenced by the element in this resource, ignores indirectly referenced objects
example of use :
var report : Set<DanglingDiagnostic>
report := resource.findDanglingModelElements()
report.each{ diag | stdio.writeln(diag.toString ) }
The entities contained in the model-instance, that are provided when user loads a resource
instances == rootContents
this is a loop on Resource itself in order to get backward compatibility
@
Loads the Resource, thus making content of the Resource browsable.
Raises a ResourceLoadException in case loaded Resource is empty
Return a normalized version of the Uri of this resource
in order to prevent several loading of the same file because they have different path that leads to them, kermeta uses normalizedURI
for some of its functions (eg. repository.getResource )
As EMF needs URI of the form platform:/resource or platform:/plugin, kermeta automatically
normalize the uri when loading or saving. This is especially true for file:/ uri or relative uri (./ or / )
If you wish to know what concrete uri is used by kermeta when loading and saving you can use this function
to check how a given uri is normalized by kermeta
Save a Resource in the file specified by the current value of uri
Save a Resource in a file referenced by the new uri.
note: this doesn't change the URI of the resource, it is only saved in another place
Returns the set of all Objects directly or indirectly contained by the Resource,
or an empty set if the Resource is empty
implementation note: since this derived property build a set, it guarantees the unicity, as a drawback,
calling this property on large resources will be really slow due to this verification. some user may prefer
to reimplement it using a bag.
Returns the set of Resources the current Resource, which must have been loaded,
depends on, an empty set if current Resource has no dependency
Indicates weither this resource will be updated when saving the repository
This is useful if the repository contains some metamodels that should not be saved.
Note that in the current version, it doesn't ensure that you have not modified its content (using the freeze)
If you modify the elements of such resource, other resource that depend on it will be incorrectly saved
Uri of the meta-model of the Resource to load
Repository used to create the Resource
This feature is supposed read only, otherwise it cannot garantee that an element is contained by only
one Resource of a given Repository
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?
@
Contains the definition of a Kermeta exception and a few basic exceptions.
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.
@
to be written #########################################
@
The stack trace as a String
Filled by the interpreted when the exception is raised
Generic exceptions
The main class from which all the exception inherit
@
Raised by the Object::set operation if the type of the
Object to set has an incompatible type.
@
Occurs when calling next() operation while iterator is already
positioned on the last element of a collection
@
Use this exception when you want to forbid the access to an unimplemented operation
and invite to implement it
@
to be written #########################################
@
Occurs when a cast (Object::asType operation) fails
@
Use this exception when user tries to add an element to a property which type is collection
which has an upper bound != -1 ( ie *)
@
Contains file input/output related classes.
Contains standard input/output related classes.
Reads a text file
Writes a String in a text file
Writes a String in a text file by using a specific encoding
Implementation of simple helpers to read ans write text files
@
Writes the object to error output
Writeln the object to error output
Reads a String from standard input
Writes the object to standard output
Writeln the object to standard output
An implementation of StdIO : standard input/output
@
Contains a set of classes whose function is to evaluate a kermeta
expression written as a string.
Execute the expression given as a string.
the self type and formal parameters are supposed to be set
before calling this operation
Execute the expression in the given context
Initializes the formalParameters with an empty set of parameters
and the self type with void
Parse the expression as a string
and updates the expression field and errors
Returns true if the expression was parsed sucessfuly
Parse errors and type errors
Formal parameters of the expression (bindings between parameters' names and types)
The type of the self object
or void if the expression is not to be executed
in the context of an object
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)
@
Kermeta language error in a code written in Kermeta
@
Kermeta error for parsing problems
@
Type errors in a code written in Kermeta
@
Contains the definition of a Kermeta classes used for compatibility with Ecore
Kermeta representation of EMF EFeatureMapEntry
it contains the name of the required feature and the actual value
@
Package kermeta
kermeta
@
The root package. See the other packages if you want to browse the classes of Kermeta api.
The root package. See the other packages if you want to browse the classes of Kermeta api.
Class DummyClass
kermeta::DummyClass inherits kermeta::language::structure::Object
@This class is used to workaround an EMF bug, it doesn't really belong to Kermeta 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.
main features of the famous Unit test tool for Kermeta language
Operation assert
operation assert(condition : kermeta::standard::Boolean) : Void
process the given condition and react if it is not satisfied
Operation assertEqual
operation assertEqual(expected : kermeta::standard::String, actual : kermeta::standard::String) : Void
process the two given string and react if they are not equal
Operation assertFalse
operation assertFalse(condition : kermeta::standard::Boolean) : Void
process the given condition and react if it is satisfied
Operation assertFalseWithMsg
operation assertFalseWithMsg(condition : kermeta::standard::Boolean, message : kermeta::standard::String) : Void
process the given condition and react with the given message
if it is satisfied
Operation assertSimilar
operation assertSimilar(expected : kermeta::standard::String, actual : kermeta::standard::String) : Void
Log a failure if the two strings are not identical modulo-white-space
Operation assertTrue
operation assertTrue(condition : kermeta::standard::Boolean) : Void
process the given condition and react if it is not satisfied
Operation assertTrueWithMsg
operation assertTrueWithMsg(condition : kermeta::standard::Boolean, message : kermeta::standard::String) : Void
process the given condition and react with the given message
if it is not satisfied
Operation assertWithMsg
operation assertWithMsg(condition : kermeta::standard::Boolean, msg : kermeta::standard::String) : Void
process the given condition and react with the given message
if it is not satisfied
Operation distil
* reduces all runs of white-space to a single space character
Operation fail
operation fail(msg : kermeta::standard::String) : Void
to be used if a failure reaction is needed
Class AbstractFallible
kermeta::kunit::AbstractFallible inherits kermeta::language::structure::Object
to be written ############################
@
Operation assert
method assert(condition : kermeta::standard::Boolean) : Void from kermeta::kunit::AbstractFallible
Fails if condition is false
Operation assertEqual
method assertEqual(expected : kermeta::standard::String, actual : kermeta::standard::String) : Void from kermeta::kunit::AbstractFallible
Will fail if the two strings are not identical
Operation assertFalse
method assertFalse(condition : kermeta::standard::Boolean) : Void from kermeta::kunit::AbstractFallible
will fail if condition is true
Operation assertFalseWithMsg
method assertFalseWithMsg(condition : kermeta::standard::Boolean, msg : kermeta::standard::String) : Void from kermeta::kunit::AbstractFallible
will fail if condition is true
Operation assertTrue
method assertTrue(condition : kermeta::standard::Boolean) : Void from kermeta::kunit::AbstractFallible
will fail if condition is false
Operation assertTrueWithMsg
method assertTrueWithMsg(condition : kermeta::standard::Boolean, msg : kermeta::standard::String) : Void from kermeta::kunit::AbstractFallible
will fail if condition is false
Operation assertWithMsg
method assertWithMsg(condition : kermeta::standard::Boolean, msg : kermeta::standard::String) : Void from kermeta::kunit::AbstractFallible
will fail if condition is false
Operation fail
method fail(msg : kermeta::standard::String) : Void from kermeta::kunit::AbstractFallible
raise a AssertionViolatedException with the provided message
Class AssertionFailedError
kermeta::kunit::AssertionFailedError inherits kermeta::exceptions::Exception
AssertionViolatedException are raised when assertions are violated @
Operation initFrom
operation initFrom(error : kermeta::kunit::Fallible, e : kermeta::exceptions::Exception) : kermeta::kunit::Error
Sets up a new error with failable object and the exception that occurred
by default it will be a test error. Use makeSetUp or makeTearDown to
change its type
Operation makeSetUp
operation makeSetUp() : kermeta::kunit::Error
Changes the type of an error to SetUpError, the best way to use
this method is to call it after the init from line:
var e : Error init Error.new.initFrom(f, e).makeSetUp
Operation makeTearDown
operation makeTearDown() : kermeta::kunit::Error
Changes the type of an error to makeTearDownError, the best way to use
this method is to call it after the init from line:
var e : Error init Error.new.initFrom(f, e).makeTearDown
Operation toString
method toString() : kermeta::standard::String from kermeta::language::structure::Object
overwrite the default method, in order to add :
- the type
- the message
- the stack trace
Property exception
reference exception: kermeta::exceptions::Exception
the Kermeta exception corresponding to the error
Property kind
attribute kind: kermeta::kunit::ErrorKind
the nature of the stored error
Class Error
kermeta::kunit::Error inherits kermeta::language::structure::Object
Error represents an occurrence of an exception in setUp, tearDown or a test
and is stored in a failure log
@
Operation initFrom
operation initFrom(fallible : kermeta::kunit::Fallible, msg : kermeta::standard::String) : kermeta::kunit::Failure
initialization of the failure
Operation toString
method toString() : kermeta::standard::String from kermeta::language::structure::Object
overwrite the default method, in order to add the message
Property message
reference message: kermeta::standard::String
the stored message (given or generated one)
Class Failure
kermeta::kunit::Failure inherits kermeta::language::structure::Object
Failure represents an assertion failure stored in a failure log
@
Operation assert
method assert(condition : kermeta::standard::Boolean) : Void from kermeta::kunit::AbstractFallible
Log a failure if condition is false
Operation assertEqual
method assertEqual(expected : kermeta::standard::String, actual : kermeta::standard::String) : Void from kermeta::kunit::AbstractFallible
Log a failure if the two strings are not identical
Operation assertFalse
method assertFalse(condition : kermeta::standard::Boolean) : Void from kermeta::kunit::AbstractFallible
Log a failure if condition is true
Operation assertFalseWithMsg
method assertFalseWithMsg(condition : kermeta::standard::Boolean, message : kermeta::standard::String) : Void from kermeta::kunit::AbstractFallible
Log a failure if condition is true
Operation assertTrue
method assertTrue(condition : kermeta::standard::Boolean) : Void from kermeta::kunit::AbstractFallible
Log a failure if condition is false
Operation assertTrueWithMsg
method assertTrueWithMsg(condition : kermeta::standard::Boolean, message : kermeta::standard::String) : Void from kermeta::kunit::AbstractFallible
Log a failure if condition is false
Operation assertWithMsg
method assertWithMsg(condition : kermeta::standard::Boolean, msg : kermeta::standard::String) : Void from kermeta::kunit::AbstractFallible
Log a failure if condition is false
Operation fail
method fail(msg : kermeta::standard::String) : Void from kermeta::kunit::AbstractFallible
Log a failure
Operation number
operation number() : kermeta::standard::Integer
current order position of counter of assertions
Property stopOnFailure
attribute stopOnFailure: kermeta::standard::Boolean
Set this attribute to false if you wish your test to not stop if the assert fails.
note : if set to false, the count of failures/errors may be bigger that the number of executed test operations
Class Fallible
kermeta::kunit::Fallible inherits kermeta::kunit::AbstractFallible
This is represents the aspect of tests that they may go wrong.
it defines the ability to define the conditions for success
(assertions) and the mechanism for recording that those
conditions have not been met.
@
Class InvalidParameterException
kermeta::kunit::InvalidParameterException inherits kermeta::exceptions::Exception
This is for when we try to build a suite from a class that isn't a TestCase
@
Class InvalidTestCaseNameException
kermeta::kunit::InvalidTestCaseNameException inherits kermeta::exceptions::Exception
This exception is rose if there is a problem on the name of the test method
@
Operation addFailure
Adds a failed test to the list of failed tests
Operation addSetUpError
Adds errors which occur during the SetUp phase
Operation addTearDownError
operation addTearDownError(test : kermeta::kunit::Fallible, e : kermeta::exceptions::Exception) : Void
Adds errors which occur during the TearDown phase
Operation addTestError
Adds an error to the list of errors
Operation newAttempt
operation newAttempt() : Void
Increments the runtests counter
Property failures
reference failures: kermeta::kunit::Failure[0..*]
list of detected assertion failures
Property harnessErrors
reference harnessErrors: kermeta::kunit::Error[0..*]
list of detected errors with the test harness
Class Log
kermeta::kunit::Log inherits kermeta::language::structure::Object
Log is a log of failures and errors that happened to fallibles since start was called
@
Operation run
operation run() : Void
Execute the test and verify its assertions
Operation setLog
operation setLog(log : kermeta::kunit::Log) : Void
Initializes the log where failures and errors will be put
Class Test
kermeta::kunit::Test inherits kermeta::language::structure::Object
The abstact notion of a test which is runnable and which has a log
in which it can keep note of failures
@
Operation getLog
method getLog() : kermeta::kunit::Log from kermeta::kunit::Fallible
accessor on the log
Operation getTestMethodName
operation getTestMethodName() : kermeta::standard::String
accessor on the method name
Operation raiseIfHasFailures
operation raiseIfHasFailures() : Void
operation used when the TestCase is run from a java test runner, encapsulates the failures results
into an AssertionFailedError so the TestRunner can detect it
Operation run
method run() : kermeta::standard::Void from kermeta::kunit::Test
Execute the whole test case : SetUp, test method, TearDown
The assertions of the test method are computed
Operation setTestMethodName
Sets the name of the method from the concrete subclass of
TestCase that should be executed when this TestCase instance
is run as a test.
Throws invalidTestCaseNameException if the given string is not
the name of a method in the test case
Operation setUp
operation setUp() : Void
the things to be done before execution of the test method
(designed to be overwritten in real TestCase classes)
Operation tearDown
operation tearDown() : Void
the things to be done after execution of the test method
(designed to be overwritten in real TestCase classes)
Operation toString
method toString() : kermeta::standard::String from kermeta::language::structure::Object
overwrites the default method for more informative output
Property __testMethodName
attribute __testMethodName: kermeta::standard::String
the name of the method which corresponds to the test case in the test class
Class TestCase
A test case comprises one or more test methods plus
setUp and tearDown that build and destroy their test harness.
An instance of a subclass of TestCase should have its
testMethodName set to the name of one of its operations
which should be called whe the test is run. You can do this
yourself:
var testCase : TestCase init MyTestCaseClass.new.setTestMethodName("testSomething")
Alternatively if your TestCase Class has many methods whose
name begins with 'test' you can create a set of instaces already
set up with their testMethodName using the addAllTestCasesFrom
operation on TestSuite
@
Operation printTestResult
operation printTestResult() : kermeta::standard::Void
Prints the log or errors and failures from a test run.
Run some tests first.
Operation run
operation run(testCaseClass : kermeta::language::structure::Class) : Void
For backwards compatibility with old kunit, this takes a test case class
and creates the necessary suite, and runs it. DEPRECATED
Operation runTest
operation runTest(test : kermeta::kunit::Test) : Void
Use this to run a test case or a test suite.
If you want to run all the test.... methods in a TestCase class,
you can populate a suite with TestSuite.addAllTestCasesFrom
Class TestRunner
kermeta::kunit::TestRunner inherits kermeta::language::structure::Object
Create and use a test runner to run one or more tests and print the failure log. E.g.:
do
var suite : TestSuite init TestSuite.new.addAllTestCasesFrom(InterestingTestCaseSet)
var runner : TestRunner init TestRunner.new
runner.run(suite)
runner.printLogs
end
Where InterestingTestCaseSet is a subclass of TestCase and contains several test... methods
@
Operation addAllTestCasesFrom
operation addAllTestCasesFrom(testCaseClass : kermeta::language::structure::Class) : kermeta::kunit::TestSuite
Add to this suite, a set of test cases of type c, one for each
test method in class c. C must be a descendent of TestCase
Operation addAllTestCasesFromAspects
operation addAllTestCasesFromAspects(testCaseClass : kermeta::language::structure::Class, anAspect : kermeta::language::structure::ClassDefinition) : Void
to be written #####################################################
Operation run
method run() : kermeta::standard::Void from kermeta::kunit::Test
Run all the tests in the test suite
Property tests
reference tests: kermeta::kunit::Test[0..*]
The collection of tests which will be ran as the suite
Class TestSuite
kermeta::kunit::TestSuite inherits kermeta::kunit::Test
A TestSuite is a structured collection of tests, using the
composite pattern, all tests are runnable and have a log
In addition a suite can be populated automatically from a
test case class with one test case object for each test
method in the class.
You can make a suite and populate it manually like this:
var suite : TestSuite init TestSuite.new.
suite.tests.add(t1)
Alternatively you can populate a suite automatically from
a class that inherits TestCase and which has several methods
called test:
var suite : TestSuite init TestSuite.new.addAllTestCasesFrom(InterestingTestCaseSet)
@
Package language
kermeta::language
@
Contains the implementation of Kermeta reflective collections.
Contains the implementation of Kermeta reflective collections.
Class DummyClass
kermeta::language::DummyClass inherits kermeta::language::structure::Object
@This class is used to workaround an EMF bug, it doesn't really belong to Kermeta metamodel
Operation add
method add(element : G) : Void from kermeta::standard::Set
Overrides kermeta::standard::Set<G>.add(G)
Add an element to this collection and update its opposite property if it exists.
Operation clear
method clear() : Void from kermeta::standard::Collection
Overrides kermeta::standard::Collection<G>.clear(G)
Operation remove
method remove(element : G) : Void from kermeta::standard::Set
Overrides kermeta::standard::Set<G>.remove(G)
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
Overrides kermeta::language::ReflectiveCollection<G>.add(G)
Operation addAt
method addAt(index : kermeta::standard::Integer, element : G) : Void from kermeta::standard::OrderedSet
Overrides kermeta::standard::OrderedSet.addAt(Integer)
Operation clear
method clear() : Void from kermeta::language::ReflectiveCollection
Overrides kermeta::language::ReflectiveCollection<G>.clear()
Operation equals
method equals(element : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::standard::OrderedSet
Overrides kermeta::standard::OrderedSet.equals(Object)
Operation remove
method remove(element : G) : Void from kermeta::language::ReflectiveCollection
Overrides kermeta::language::ReflectiveCollection<G>.remove(G)
Operation removeAt
method removeAt(index : kermeta::standard::Integer) : Void from kermeta::standard::OrderedCollection
Overrides kermeta::standard::OrderedSet.removeAt(Integer)
Class ReflectiveSequence
kermeta::language::ReflectiveSequence<G> inherits kermeta::standard::OrderedSet<G>, kermeta::language::ReflectiveCollection<G>
ReflectiveSequence is an ordered ReflectiveCollection.
@
Package structure
kermeta::language::structure
@
Contains the concrete implementation (including the operation bodies)
of the classes of the
If you need more documentation, please take a look at the
Contains the concrete implementation (including the operation bodies)
of the classes of the
kermeta::reflection
package.If you need more documentation, please take a look at the
kermeta::reflection
package which is more complete.Alias Boolean
kermeta::language::structure::Boolean
@
Operation clone
method clone(objectToClone : kermeta::language::structure::Object) : kermeta::language::structure::Object from kermeta::language::structure::Type
@
Operation deepClone
method deepClone(objectToClone : kermeta::language::structure::Object) : kermeta::language::structure::Object from kermeta::language::structure::Type
@
Operation equals
method equals(other : kermeta::language::structure::Object) : kermeta::language::structure::Boolean from kermeta::language::structure::Object
@
Operation new
operation new() : kermeta::language::structure::Object
Instantiates a new occurence for this Class
@
Operation toString
method toString() : kermeta::language::structure::String from kermeta::language::structure::Object
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.
Property classDefinition
property classDefinition: kermeta::language::structure::ClassDefinition readonly
Returns the ClassDefinition for this class
Property isAbstract
property isAbstract: kermeta::language::structure::Boolean readonly
@Returns a Boolean stating whether ClassDefinition of this Class is abstract.
Property name
property name: kermeta::language::structure::String readonly
@Returns the name of the ClassDefinition of this Class
Property ownedAttribute
property ownedAttribute: set kermeta::language::structure::Property[0..*] readonly
@Returns the Attributes, References, and derived Properties owned by
the ClassDefinition of this Class.
the ClassDefinition of this Class.
Property ownedOperation
property ownedOperation: kermeta::language::structure::Operation[0..*] readonly
@Returns the Operations owned by the ClassDefinition of this Class.
Property superClass
property superClass: set kermeta::language::structure::Class[0..*] readonly
@Returns the Classes of which the ClassDefinition of this Class inherits.
Class Class
kermeta::language::structure::Class inherits kermeta::language::structure::ParameterizedType
@Returns the Attributes, References, and derived Properties owned by
the ClassDefinition of this Class.
the ClassDefinition of this Class.
Operation allSuperTypes
Returns all the types directly and indirectly inherited by this ClasDefinition
Operation getCachedAllAttribute
returns a cached version of the derived property allAttribute
It is intended to be used to optimize access on the reflexivity,
do not use this cache if you are modifying the ClassDefinition
Operation getCachedAllSuperTypes
returns a cached version of the derived property allSuperTypes
It is intended to be used to optimize access on the reflexivity,
do not use this cache if you are modifying the ClassDefinition
Property _allAttributeCache
Data structure for getCachedAllAttribute
Property _allSuperTypesCache
Data structure for getCachedAllSuperTypes
Property allAttribute
property allAttribute: set kermeta::language::structure::Property[0..*] readonly
Returns all the Attributes, References, derived Properties of this
ClassDefinition including the inherited ones
Property allOperation
property allOperation: set kermeta::language::structure::Operation[0..*] readonly
Returns all the Operations of this ClassDefinition
including the inherited ones
Property inv
attribute inv: kermeta::language::structure::Constraint[0..*]#invOwner
@Invariants defined for this ClassDefinition
Property isAbstract
attribute isAbstract: kermeta::language::structure::Boolean
@Boolean stating whether the ClassDefinition is abstract (which means that
no instance can be allocated)
no instance can be allocated)
Property ownedAttribute
attribute ownedAttribute: kermeta::language::structure::Property[0..*]#owningClass
@Attributes, References, and derived Properties owned by this ClassDefinition.
Property ownedOperation
attribute ownedOperation: kermeta::language::structure::Operation[0..*]#owningClass
@Operations owned by this ClassDefinition.
Property superType
reference superType: kermeta::language::structure::Type[0..*]
@Classes from which this ClassDefinition inherits.
Class ClassDefinition
kermeta::language::structure::ClassDefinition inherits kermeta::language::structure::GenericTypeDefinition, kermeta::language::structure::TypeContainer
@The definition of a class definition :)
A is a Class : it corresponds to the use of the class definition of A
class Ais a class definition; in :
{
attribute s : String
}
main() : A is do end
A is a Class : it corresponds to the use of the class definition of A
Property body
attribute body: kermeta::language::behavior::Expression[1..1]
@Body of the constraint, expressed as a KerMeta expression
Property invOwner
reference invOwner: kermeta::language::structure::ClassDefinition#~inv
@Owning ClassDefinition if Constraint corresponds to invariant
Property language
attribute language: kermeta::language::structure::ConstraintLanguage
@Language in which the constraint is expressed
Property postOwner
reference postOwner: kermeta::language::structure::Operation#~post
@Owning Operation if Constraint corresponds to post-condition
Property preOwner
reference preOwner: kermeta::language::structure::Operation#~pre
@Owning Operation if Constraint corresponds to pre-condition
Property stereotype
attribute stereotype: kermeta::language::structure::ConstraintType
@Type of the Constraint (precond/postcond/inv)
Class Constraint
kermeta::language::structure::Constraint inherits kermeta::language::structure::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)
Three kinds of constraints are available : pre, post, and inv (invariant constraint)
Class DataType
kermeta::language::structure::DataType inherits kermeta::language::structure::Type, kermeta::language::structure::TypeDefinition
@Special type definition for Enumeration, PrimitiveType
Operation clone
method clone(objectToClone : kermeta::language::structure::Object) : kermeta::language::structure::Object from kermeta::language::structure::Type
Implements kermeta::language::structure::Type.clone(Object)
@
Property ownedLiteral
attribute ownedLiteral: kermeta::language::structure::EnumerationLiteral[0..*]#~enumeration
@Owned items in an Enumeration
Class Enumeration
kermeta::language::structure::Enumeration inherits kermeta::language::structure::DataType
@Definition for Enumeration
Property enumeration
reference enumeration: kermeta::language::structure::Enumeration#ownedLiteral
@@Owning Enumeration
Class EnumerationLiteral
kermeta::language::structure::EnumerationLiteral inherits kermeta::language::structure::NamedElement
@Item definition for enumeration
Property qualifiedName
attribute qualifiedName: kermeta::language::structure::String
@To be written
Class Filter
kermeta::language::structure::Filter inherits kermeta::language::structure::Object
@Filter is the class that represent a filter on a ModelingUnit.
the qualifiedName represent the beginning of the matched names
the qualifiedName represent the beginning of the matched names
Property left
reference left: kermeta::language::structure::Type
@Parameters of the function (a ProductType for multiple parameters)
Class FunctionType
kermeta::language::structure::FunctionType inherits kermeta::language::structure::TypeContainer, kermeta::language::structure::Type
@Type used to define the use of lambda expressions.
Uses :
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
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: kermeta::language::structure::TypeVariable[0..*]
@Type variables defined for the GenericTypeDefinition
Class GenericTypeDefinition
kermeta::language::structure::GenericTypeDefinition inherits kermeta::language::structure::TypeDefinition
@Abstracts the definition of generic type definitions (i.e. type definitions that
can be parameterized), namely, for ClassDefinition and ModelTypeDefinition.
can be parameterized), namely, for ClassDefinition and ModelTypeDefinition.
Alias Integer
kermeta::language::structure::Integer
@
Operation add
operation add(obj : kermeta::language::structure::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::language::structure::Object>) : kermeta::standard::Collection<kermeta::language::structure::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(objectToAdd : kermeta::language::structure::Object) : kermeta::language::structure::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(typeName : kermeta::language::structure::Type) : kermeta::standard::Set<kermeta::language::structure::Object>
Returns a set of all the elements of the model that are instance of the given Type
@
Operation remove
operation remove(obj : kermeta::language::structure::Object) : Void
Remove an object from the model
@
Property contents
reference contents: kermeta::language::structure::Object[0..*] readonly
@Contents of this model...
Class Model
kermeta::language::structure::Model inherits kermeta::language::structure::Object
@Is the holder of a set of model elements (Object) that are compatible with the ModelType that has
instantiated this Model.
instantiated this Model.
Operation isModelTypeOf
operation isModelTypeOf(m : kermeta::language::structure::Model) : kermeta::language::structure::Boolean
To be written ##########################################
@
Operation new
operation new() : kermeta::language::structure::Model
To be written ##########################################
@
Property includedTypeDefinition
reference includedTypeDefinition: kermeta::language::structure::TypeDefinition[0..*]
@To be written
Class ModelType
kermeta::language::structure::ModelType inherits kermeta::language::structure::Type, kermeta::language::structure::TypeDefinition
@Type of a model, consisting of a set of included type definitions
Property virtualType
attribute virtualType: kermeta::language::structure::VirtualType[0..*]#modelType
@To be written
Class ModelTypeVariable
kermeta::language::structure::ModelTypeVariable inherits kermeta::language::structure::TypeVariable
@To be written
Property excludeFilters
attribute excludeFilters: kermeta::language::structure::Filter[0..*]
@list of filters that apply to this modeling unit.
This means that if the same unit was loaded without this filters, it would have loaded more content
element whose qualified name begins with one of these filter will NOT be loaded in the unit
This means that if the same unit was loaded without this filters, it would have loaded more content
element whose qualified name begins with one of these filter will NOT be loaded in the unit
Property includeFilters
attribute includeFilters: kermeta::language::structure::Filter[0..*]
@list of filters that apply to this modeling unit.
This means that if the same unit was loaded without this filters, it would have loaded more content
only element whose qualified name begins with one of these filter will be loaded in the unit
This means that if the same unit was loaded without this filters, it would have loaded more content
only element whose qualified name begins with one of these filter will be loaded in the unit
Property packages
attribute packages: kermeta::language::structure::Package[0..*]
@root packages contained by this ModelingUnit
Property referencedModelingUnits
reference referencedModelingUnits: kermeta::language::structure::ModelingUnit[0..*]
@To be written
Property requires
attribute requires: kermeta::language::structure::Require[0..*]
@Set of "require" statements associated with this ModelingUnit. Ie. list of the other
files required to run this unit
files required to run this unit
Property usings
attribute usings: kermeta::language::structure::Using[0..*]
@Set of "using" statement associated with this ModelingUnit. Ie. list of "syntatic shortcut"
that can be used within this unit.
that can be used within this unit.
Class ModelingUnit
kermeta::language::structure::ModelingUnit inherits kermeta::language::structure::Object
@The modeling unit is the root of any kermeta model. It contains packages, requires and usings.
It also reference others modeling unit.
It also reference others modeling unit.
Property isOrdered
attribute isOrdered: kermeta::language::structure::Boolean
@Boolean stating whether the element is ordered
Property isUnique
attribute isUnique: kermeta::language::structure::Boolean
@Boolean stating whether duplicated elements are allowed
Property lower
attribute lower: kermeta::language::structure::Integer
@Min cardinality of the element
Property upper
attribute upper: kermeta::language::structure::UnlimitedNatural
@Max cardinality of the element, '-1' for '*'
Class MultiplicityElement
kermeta::language::structure::MultiplicityElement inherits kermeta::language::structure::TypedElement
@ Model elements with a multiplicity [lower..upper] inherit this class
Operation qualifiedName
operation qualifiedName() : kermeta::language::structure::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::language::structure::String[1..1]
@Name of this named element
Class NamedElement
kermeta::language::structure::NamedElement inherits kermeta::language::structure::Object
@Any element that contain a name (example : Operation, Property) inherit this
class.
class.
Operation asType
Implementation of OCL like cast. It returns self if the object object conforms to the type given as parameter.
@
Operation checkAllInvariants
operation checkAllInvariants() : Void
Recursively runs checking of invariants defined for the metaclass of the Object
and its supertypes
Ignores derived attributes.
@
Operation checkInvariant
operation checkInvariant(invariant : kermeta::language::structure::Constraint) : Void
Checks a constraint invariant defined for the metaclass of the Object
You can use PropertyConstraint for checking structural constraints associated to a property
@
Operation checkInvariants
operation checkInvariants() : Void
Runs checking of invariants defined for the metaclass of the Object
Also check the multiplicity of attributes (except derived and transient attributes)
@
Operation container
operation container() : kermeta::language::structure::Object
Returns the Object that contains current Object, void if the Object has
no container
@
Operation containingResource
operation containingResource() : kermeta::persistence::Resource
Returns the Resource currently containing (directly or indirectly) the Object
or void if the object belongs to no Resource
@
Operation equals
operation equals(element : kermeta::language::structure::Object) : kermeta::language::structure::Boolean
semantic equality,
if you wish to test for object identity you need to use the method oid
ex: x.oid == y.oid
by default, (ie. if not overloaded), the equals method for class Object implements
the most discriminating possible equivalence relation on objects; that is, for any non-null
reference values x and y, this method returns true if and only if x and y refer to the same
object (x.oid == y.oid has the value true).
note1: the operator == is mapped to this
note2: overloading this operation have some impact on the behavior on collection and hashtable that rely on it
@
Operation freeze
operation freeze() : Void
Freeze the Object
@
Operation get
operation get(~property : kermeta::language::structure::Property) : kermeta::language::structure::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::language::structure::Class
Returns the Class object that is the metaclass of current Object
@
Operation getViolatedConstraints
operation getViolatedConstraints() : kermeta::exceptions::ConstraintsDiagnostic
Checks all the invariants for this object and return a complete diagnostic.
This also includes the structural constraints associated to the properties.
@
Operation hashcode
operation hashcode() : kermeta::language::structure::Integer
code used in hashtable in order to identify an object in the hashtable keys
This system is similar to the hashcode used in java. Please refer to java documentation
for more information about hashcode
@
Operation isFrozen
operation isFrozen() : kermeta::language::structure::Boolean
Returns a Boolean stating whether the Object is currently in a
frozen state
@
Operation isInstanceOf
operation isInstanceOf(type : kermeta::language::structure::Type) : kermeta::language::structure::Boolean
Returns a Boolean stating whether the current Object conforms to given Type
This means: is this object an instance of this type, or is it an instance of its subtype
@
Operation isKindOf
operation isKindOf(cl : kermeta::language::structure::Class) : kermeta::language::structure::Boolean
Returns a Boolean stating whether the current Object is an instance of the given Class
Operation isNotEqual
operation isNotEqual(element : kermeta::language::structure::Object) : kermeta::language::structure::Boolean
See kermeta::language::structure::Object.equals(Object)
@
Operation isSet
operation isSet(~property : kermeta::language::structure::Property) : kermeta::language::structure::Boolean
True if the
~property
of the object has been set@
Operation isVoid
operation isVoid() : kermeta::language::structure::Boolean
Returns a Boolean stating whether the Object is Void
@
Operation oid
operation oid() : kermeta::language::structure::Integer
Returns the unique Oid of the Object
@
Operation set
operation ~set(~property : kermeta::language::structure::Property, element : kermeta::language::structure::Object) : Void
Sets the
element
to the ~property
of the object @
Operation toString
operation toString() : kermeta::language::structure::String
Implements Object.toString()
Returns a String of form [qn:oid] where 'qn' is the qualified name of
the object type, and oid the unique ID of the object
@
Operation unset
operation unset(~property : kermeta::language::structure::Property) : Void
Remove the element set as the
~property
of the object.The
isSet(~property)
method will then return False@
Property ownedTags
attribute ownedTags: kermeta::language::structure::Tag[0..*]
@An object can contains a Tag.
Be careful, owning a tag doesn't means that the tag applies to the Object
To know which Tags apply to the object use the "tag" reference
Be careful, owning a tag doesn't means that the tag applies to the Object
To know which Tags apply to the object use the "tag" reference
Property tag
reference tag: kermeta::language::structure::Tag[0..*]#object
@An Object can be tagged by a Tag.
They are typically used to put comments/documentation on the object
They are typically used to put comments/documentation on the object
Class Object
kermeta::language::structure::Object
@Object definition: all entities of Kermeta metamodel explicitly inherit from Object
Class ObjectTypeVariable
kermeta::language::structure::ObjectTypeVariable inherits kermeta::language::structure::TypeVariable
@To be written
Property body
attribute body: kermeta::language::behavior::Expression
@Body of the Operation, expressed as a KerMeta expression
Property isAbstract
attribute isAbstract: kermeta::language::structure::Boolean
@Boolean stating whether the Operation is abstract
Property ownedParameter
attribute ownedParameter: kermeta::language::structure::Parameter[0..*]#~operation
@Parameters of the Operation
Property owningClass
reference owningClass: kermeta::language::structure::ClassDefinition#ownedOperation
@ClassDefinition owning the Operation
Property post
attribute post: kermeta::language::structure::Constraint[0..*]#postOwner
@Post-conditions of the Operation
Property pre
attribute pre: kermeta::language::structure::Constraint[0..*]#preOwner
@Pre-conditions of the Operation
Property raisedException
reference raisedException: kermeta::language::structure::Type[0..*]
@Exceptions raised by the Operation
Property superOperation
reference superOperation: kermeta::language::structure::Operation
@Super-operation of the Operation, if any
Property typeParameter
reference typeParameter: kermeta::language::structure::TypeVariable[0..*]
@TypeParameters of the Operation
Class Operation
kermeta::language::structure::Operation inherits kermeta::language::structure::MultiplicityElement
@Every one knows what an operation is.
Property nestedPackage
attribute nestedPackage: kermeta::language::structure::Package[0..*]#nestingPackage
@Nested Packages contained by the Package
Property nestingPackage
reference nestingPackage: kermeta::language::structure::Package#nestedPackage
@@Owning Package, if any
Property uri
attribute uri: kermeta::language::structure::String
@Uri of the Package
Class Package
kermeta::language::structure::Package inherits kermeta::language::structure::NamedElement, kermeta::language::structure::TypeDefinitionContainer
@Package in kermeta. Each kermeta model must have a root package.
Property operation
reference operation: kermeta::language::structure::Operation#ownedParameter
@@Owning operation
Class Parameter
kermeta::language::structure::Parameter inherits kermeta::language::structure::MultiplicityElement
@Definition for operation parameter
Property typeDefinition
reference typeDefinition: kermeta::language::structure::GenericTypeDefinition[1..1]
@Definition of the Type
Property typeParamBinding
attribute typeParamBinding: kermeta::language::structure::TypeVariableBinding[0..*]
@Bindings between type variables and provided types
Property virtualTypeBinding
attribute virtualTypeBinding: kermeta::language::structure::TypeVariableBinding[0..*]
@To be written
Class ParameterizedType
kermeta::language::structure::ParameterizedType inherits kermeta::language::structure::Type
@Abstraction for Parameterized types, namely, Class and ModelType
Property instanceType
reference instanceType: kermeta::language::structure::Type
@The type the primitive type is linked with
Class PrimitiveType
kermeta::language::structure::PrimitiveType inherits kermeta::language::structure::DataType, kermeta::language::structure::TypeContainer
@The class definition for kermeta aliases. Above statement defines a primitive
type called MyString, which instanceType is
type called MyString, which instanceType is
kermeta::standard::String
alias MyString : kermeta::standard::String. Another example could be:
root::apackage::AClass
alias MyClass : root::apackage::AClass, thus a primitive type may be not a subtype of ValueType (ValueType is a concept from the Kermeta framework).
Class ProductType
kermeta::language::structure::ProductType inherits kermeta::language::structure::TypeContainer, kermeta::language::structure::Type
@Type corresponding to a set of Types
Only used in the context of FunctionType
Only used in the context of FunctionType
Operation getViolatedConstraintsMustDrillDown
operation getViolatedConstraintsMustDrillDown() : kermeta::language::structure::Boolean
@
Property default
attribute default: kermeta::language::structure::String
@To be written
Property getViolatedConstraintsMustDrillDownCache
attribute getViolatedConstraintsMustDrillDownCache: kermeta::language::structure::Boolean
Undocumented
Property isComposite
attribute isComposite: kermeta::language::structure::Boolean
@Boolean stating whether the Property has a containment role
Property isDerived
attribute isDerived: kermeta::language::structure::Boolean
@If True, the value of the property is not stored but computed from other properties
Property isGetterAbstract
attribute isGetterAbstract: kermeta::language::structure::Boolean
@Boolean stating wether the getter is abstract.
Property isID
attribute isID: kermeta::language::structure::Boolean
@Boolean stating whether the property allows to identify its containing Object
Property isReadOnly
attribute isReadOnly: kermeta::language::structure::Boolean
@Boolean stating whether the Property is read-only
Property isSetterAbstract
attribute isSetterAbstract: kermeta::language::structure::Boolean
@Boolean stating wether the setter is abstract.
Property opposite
reference opposite: kermeta::language::structure::Property
@Opposite Property of the Property, void if the Property has no opposite
Property owningClass
reference owningClass: kermeta::language::structure::ClassDefinition#ownedAttribute
@ClassDefinition that owns the Property
Property propertyConstraint
attribute propertyConstraint: kermeta::language::structure::PropertyConstraint#~property
special constraint that apply to this Property
Used by the getViolatedConstraints
Used by the getViolatedConstraints
Class Property
kermeta::language::structure::Property inherits kermeta::language::structure::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
- Property with isComposite == true or with type is a base type (String, Integer, Boolean) : EAttribute
- Property with isComposite == false : EReference
Property property
reference property: kermeta::language::structure::Property#propertyConstraint
The property that is checked by this constraint
Typically, it will check the lower and upper bounds
Class PropertyConstraint
kermeta::language::structure::PropertyConstraint inherits kermeta::language::structure::Constraint
Undocumented. See also inherited classes.
Property uri
attribute uri: kermeta::language::structure::String
@To be written
Class Require
kermeta::language::structure::Require inherits kermeta::language::structure::Object
@To be written
Alias String
kermeta::language::structure::String
@
Property name
attribute name: kermeta::language::structure::String
@Name of the Tag
Property object
reference object: kermeta::language::structure::Object[1..*]#tag
@Objects to which the Tag is attached to
Property value
attribute value: kermeta::language::structure::String
@String value of the Tag
Class Tag
kermeta::language::structure::Tag inherits kermeta::language::structure::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.
or add some textual information that cannot be expressed with any
model element definition.
Operation clone
operation clone(objectToClone : kermeta::language::structure::Object) : kermeta::language::structure::Object
Returns a copy of passed Object built by recursively copying attribute
properties, and referencing original reference properties values
@
Operation deepClone
operation deepClone(objectToClone : kermeta::language::structure::Object) : kermeta::language::structure::Object
Returns a copy of passed Object built by recursively copying values of
all properties, no matter the property kind
@
Operation isInstance
operation isInstance(element : kermeta::language::structure::Object) : kermeta::language::structure::Boolean
Implements Type.isInstance(Object)
@
Operation isSubTypeOf
operation isSubTypeOf(object : kermeta::language::structure::Type) : kermeta::language::structure::Boolean
Implements Type.isSubTypeOf(Type)
For technical reason, the current implementation works only with Type that comes from a kermeta declaration (ie. in a require)
it won't work with Type created programmaticaly by the user. If you need that, please ask to the kermeta developpers
to extend it.
@
Operation isSuperTypeOf
operation isSuperTypeOf(object : kermeta::language::structure::Type) : kermeta::language::structure::Boolean
Implements Type.isSuperTypeOf(Type)
For technical reason, the current implementation works only with Type that comes from a kermeta declaration (ie. in a require)
it won't work with Type created programmaticaly by the user. If you need that, please ask to the kermeta developpers
to extend it.
@
Property typeContainer
reference typeContainer: kermeta::language::structure::TypeContainer#containedType
@Owning TypeContainer, if any
Class Type
kermeta::language::structure::Type inherits kermeta::language::structure::Object
@Alias to kermeta::standard::IntegerBase class definition for the use of a type.
Property containedType
attribute containedType: kermeta::language::structure::Type[0..*]#typeContainer
@Contained types
Class TypeContainer
kermeta::language::structure::TypeContainer inherits kermeta::language::structure::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.
has a direct or indirect containment relationship with the root model element of
the metamodel. This class resolves this technical requirement.
Property isAspect
attribute isAspect: kermeta::language::structure::Boolean
@
Class TypeDefinition
kermeta::language::structure::TypeDefinition inherits kermeta::language::structure::NamedElement
@This boolean allows to tell if this Type definition is an aspect or not
If it is an aspect, then at runtime, its definition will be merged with the definition of another
TypeDefinition that has exactly the same qualified nameAbstraction for type definitions (ClassDefinition, ModelTypeDefinition, DataType inherit
this class)
If it is an aspect, then at runtime, its definition will be merged with the definition of another
TypeDefinition that has exactly the same qualified nameAbstraction for type definitions (ClassDefinition, ModelTypeDefinition, DataType inherit
this class)
Property ownedTypeDefinition
attribute ownedTypeDefinition: kermeta::language::structure::TypeDefinition[0..*]
@Contained TypeDefinitions
Class TypeDefinitionContainer
kermeta::language::structure::TypeDefinitionContainer inherits kermeta::language::structure::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.
element, that is Package. In a later release, ModelTypeDefinition will be the main container for type and
package definition.
Property supertype
reference supertype: kermeta::language::structure::Type
@Reference to the supertype, if any
Class TypeVariable
kermeta::language::structure::TypeVariable inherits kermeta::language::structure::TypeContainer, kermeta::language::structure::Type, kermeta::language::structure::NamedElement
@Definition of a type variable for generic types :
in class definition
in class definition
class AClass<X,Y> {}, X and Y are type variables.
Class TypeVariableBinding
kermeta::language::structure::TypeVariableBinding inherits kermeta::language::structure::TypeContainer
@Definition of a binding between a TypeVariable and a Type
Class TypedElement
kermeta::language::structure::TypedElement inherits kermeta::language::structure::TypeContainer, kermeta::language::structure::NamedElement
@Abstraction of the notion of typed element : each element
that is typed inherits this class.
that is typed inherits this class.
Alias UnlimitedNatural
kermeta::language::structure::UnlimitedNatural
@
Property qualifiedName
attribute qualifiedName: kermeta::language::structure::String
@To be written
Class Using
kermeta::language::structure::Using inherits kermeta::language::structure::Object
@To be written
Property classDefinition
reference classDefinition: kermeta::language::structure::ClassDefinition[1..1]
@To be written
Property modelType
reference modelType: kermeta::language::structure::ModelTypeVariable[1..1]#virtualType
@To be written
Property typeParamBinding
attribute typeParamBinding: kermeta::language::structure::TypeVariableBinding[0..*]
@To be written
Class VirtualType
kermeta::language::structure::VirtualType inherits kermeta::language::structure::ObjectTypeVariable
@To be written
Class VoidType
kermeta::language::structure::VoidType inherits kermeta::language::structure::Type
@Class definition for the
Voidtype
Package behavior
kermeta::language::behavior
@
Property isCast
attribute isCast: kermeta::language::structure::Boolean
@Boolean stating whether current assignment corresponds to a cast operation
Property target
attribute target: kermeta::language::behavior::CallExpression[1..1]
@Target of the assignment, as a CallExpression
Property value
attribute value: kermeta::language::behavior::Expression[1..1]
@Value to be assigned, as a KerMeta expression
Class Assignment
kermeta::language::behavior::Assignment inherits kermeta::language::behavior::Expression
@Assignment is the model-element representation of the assignment statement
x := y
Property rescueBlock
attribute rescueBlock: kermeta::language::behavior::Rescue[0..*]
@List of rescues defined for the block
Property statement
attribute statement: kermeta::language::behavior::Expression[0..*]
@List of statements composing the block
Class Block
kermeta::language::behavior::Block inherits kermeta::language::behavior::Expression
@Block is the model-element representation for the
do...end
block.Property value
attribute value: kermeta::language::structure::Boolean
@The concrete value represented by this literal
Class BooleanLiteral
kermeta::language::behavior::BooleanLiteral inherits kermeta::language::behavior::Literal
@This expression is a literal representing a Boolean value, typically : true or false keyword
Property name
attribute name: kermeta::language::structure::String
@A call must be named
Property parameters
attribute parameters: kermeta::language::behavior::Expression[0..*]
@Kermeta calls can embedd expressions as parameters
Property staticTypeVariableBindings
reference staticTypeVariableBindings: kermeta::language::structure::Type[0..*]
@To be written
Class CallExpression
kermeta::language::behavior::CallExpression inherits kermeta::language::behavior::Expression
@Any callable expression inherits this class, e.g :
- variable call
- feature call (
- variable call
- feature call (
a.b
: b is a feature call)Property isAtpre
attribute isAtpre: kermeta::language::structure::Boolean
@Tells whether this CallFeature represents a call to @pre in a postcondition
Property staticEnumLiteral
reference staticEnumLiteral: kermeta::language::structure::EnumerationLiteral
@To be written
Property staticOperation
reference staticOperation: kermeta::language::structure::Operation
@The method which will be executed (operation case)
and the result value passed to the caller
and the result value passed to the caller
Property staticProperty
reference staticProperty: kermeta::language::structure::Property
@The object which will be returned (property case)
Property target
attribute target: kermeta::language::behavior::Expression
@Target Expression (the owner of the feature)
Class CallFeature
kermeta::language::behavior::CallFeature inherits kermeta::language::behavior::CallExpression
@CallFeature is the model element that refers to the use of a feature, i.e either
a property or an operation in a statement. In
a property or an operation in a statement. In
stdio.writeln("hello")
, writeln
is a CallFeature.Class CallResult
kermeta::language::behavior::CallResult inherits kermeta::language::behavior::CallVariable
@This class represents a call to the special internal variable "result" that is used to store the return value of any operation
Class CallSuperOperation
kermeta::language::behavior::CallSuperOperation inherits kermeta::language::behavior::CallExpression
@This class represents a call to the operataion in the parent class
In the following example, the type of super(element) is CallSuperOperation:
class ParentClass {
operation op(element : Integer) : Integer is do
result := element + 1
end
}
class ChildClass {
method op(element : Integer) : Integer is do
result := super(element)
end
}
In the following example, the type of super(element) is CallSuperOperation:
class ParentClass {
operation op(element : Integer) : Integer is do
result := element + 1
end
}
class ChildClass {
method op(element : Integer) : Integer is do
result := super(element)
end
}
Class CallValue
kermeta::language::behavior::CallValue inherits kermeta::language::behavior::CallExpression
@CallValue refers to the use of the
only used in the body of the
value
reserved keyword. This keyword isonly used in the body of the
setter
part of derived properties.Property isAtpre
attribute isAtpre: kermeta::language::structure::Boolean
@Tells whether this CallVariable represents a call to @pre in a postcondition
Class CallVariable
kermeta::language::behavior::CallVariable inherits kermeta::language::behavior::CallExpression
@We call "CallVariable" the use of a variable in a statement.
in
in
i := j + 1
, i and j are 2 CallVariables.Property condition
attribute condition: kermeta::language::behavior::Expression[1..1]
@Condition expression of conditional statement
Property elseBody
attribute elseBody: kermeta::language::behavior::Expression
@Optional else part of the conditional statement
Property thenBody
attribute thenBody: kermeta::language::behavior::Expression[1..1]
@Then part of the conditional statement
Class Conditional
kermeta::language::behavior::Conditional inherits kermeta::language::behavior::Expression
@Condition is the model-element representation for the
Class EmptyExpression
kermeta::language::behavior::EmptyExpression inherits kermeta::language::behavior::Expression
@As suggested by its name, this class represents an expression that do nothing. Like a "nop"
Property staticType
reference staticType: kermeta::language::structure::Type
@Type of the Expression (set by type checking)
Class Expression
kermeta::language::behavior::Expression inherits kermeta::language::structure::TypeContainer
@The base class for every entity used to define a behavior in operation body.
Property value
attribute value: kermeta::language::structure::Integer
@The concrete value represented by this literal
Class IntegerLiteral
kermeta::language::behavior::IntegerLiteral inherits kermeta::language::behavior::Literal
@This expression is a literal representing an Integer value
Property jclass
attribute jclass: kermeta::language::structure::String
@Qualified name of the targeted Java class
Property jmethod
attribute jmethod: kermeta::language::structure::String
@Name of the Java method to be launched in the identified Java class
Property parameters
attribute parameters: kermeta::language::behavior::Expression[0..*]
@Parameters of the Java static call provided as KerMeta expressions
Class JavaStaticCall
kermeta::language::behavior::JavaStaticCall inherits kermeta::language::behavior::Expression
@This class represent a call to an extern Java operation.
This Java operation must be static and have at least one RuntimeO
This Java operation must be static and have at least one RuntimeO
Property body
attribute body: kermeta::language::behavior::Expression[1..1]
@Body of the lambda expression providede as a KerMeta expression
Property parameters
attribute parameters: kermeta::language::behavior::LambdaParameter[0..*]
@Parameters of the lambda expression
Class LambdaExpression
kermeta::language::behavior::LambdaExpression inherits kermeta::language::behavior::Expression
@Refers to lambda expression definition (
function { e | stdio.writeln(e.toString) }
)Property name
attribute name: kermeta::language::structure::String
@Name of the lambda parameter
Property type
attribute type: kermeta::language::behavior::TypeReference[1..1]
@To be written ################################
Class LambdaParameter
kermeta::language::behavior::LambdaParameter inherits kermeta::language::structure::Object
@Refers to parameter definition in lambda expression
Class Literal
kermeta::language::behavior::Literal inherits kermeta::language::behavior::Expression
@Literal refers to String values, Integer values, etc.
Property initialization
attribute initialization: kermeta::language::behavior::Expression
@Initialization expression for the loop
Property stopCondition
attribute stopCondition: kermeta::language::behavior::Expression[1..1]
@Stop condition of the loop, is interpreted as a Bollean value
Class Loop
kermeta::language::behavior::Loop inherits kermeta::language::behavior::Expression
@Loop refers to
from var x : X init a until booleanCondition loop ... end
Property expression
attribute expression: kermeta::language::behavior::Expression[1..1]
@To be written #######################
Class Raise
kermeta::language::behavior::Raise inherits kermeta::language::behavior::Expression
@Refers to raise exception block
Property body
attribute body: kermeta::language::behavior::Expression[1..*]
@Body of the rescue block, specified as a KerMeta expression
Property exceptionName
attribute exceptionName: kermeta::language::structure::String
@Name of the catched exception
Property exceptionType
attribute exceptionType: kermeta::language::behavior::TypeReference[1..1]
@Type of the cathed exception
Class Rescue
kermeta::language::behavior::Rescue inherits kermeta::language::structure::Object
@Refers to rescue exception block
Class SelfExpression
kermeta::language::behavior::SelfExpression inherits kermeta::language::behavior::Expression
@Refers to
self
useProperty value
attribute value: kermeta::language::structure::String
@The concrete value represented by this literal
Class StringLiteral
kermeta::language::behavior::StringLiteral inherits kermeta::language::behavior::Literal
@This expression is a literal representing a String value, typically : "my string"
Property typeref
attribute typeref: kermeta::language::behavior::TypeReference[1..1]
@The type refered by this literal
Class TypeLiteral
kermeta::language::behavior::TypeLiteral inherits kermeta::language::behavior::Literal
@This expression is a literal representing a Type.
for example, in
Integer.new
Integer is a type literal representing the type kermeta::standard::Integer
for example, in
Integer.new
Integer is a type literal representing the type kermeta::standard::Integer
Class TypeReference
kermeta::language::behavior::TypeReference inherits kermeta::language::structure::MultiplicityElement
@TypeReference refers to the type used in a variable declaration
Property identifier
attribute identifier: kermeta::language::structure::String
@Initialization expression for the variable
Default value is
Default value is
void
????Property initialization
attribute initialization: kermeta::language::behavior::Expression
@Initialization expression for the variable
Default value is
Default value is
void
????Property type
attribute type: kermeta::language::behavior::TypeReference[1..1]
@Type of the declared variable
Class VariableDecl
kermeta::language::behavior::VariableDecl inherits kermeta::language::behavior::Expression
@refers to variable declaration
var x : X init a
Class VoidLiteral
kermeta::language::behavior::VoidLiteral inherits kermeta::language::behavior::Literal
@This class is used to represent the special expression void
Package standard
kermeta::standard
Defines value types
Defines Collection types
Contains types dedicated to dealing with java objects
Operation asBag
method asBag() : kermeta::standard::Bag<G> from kermeta::standard::Collection
Overrides Collection<G>.asBag()
Returns a new Bag containing all elements of current Bag
Operation asOrderedSet
method asOrderedSet() : kermeta::standard::OrderedSet<G> from kermeta::standard::Collection
Overrides Collection<G>.asOrderedSet()
Returns a new OrderedSet containing elements of the Bag without duplicates
Operation asSequence
method asSequence() : kermeta::standard::Sequence<G> from kermeta::standard::Collection
Overrides Collection<G>.asSequence()
Returns a new Sequence containing all elements of current Bag
Operation asSet
method asSet() : kermeta::standard::Set<G> from kermeta::standard::Collection
Overrides Collection<G>.asSet()
Returns a new Set containing elements of the Bag without duplicates
Operation concatenate
operation concatenate(less : kermeta::standard::Sequence<G>, pivot : kermeta::standard::Sequence<G>, greater : kermeta::standard::Sequence<G>) : kermeta::standard::Sequence<G>
Returns a sequence of the bag elements sorted using the given comparator.
The comparator must return :<ul>
<li>+1 if the second <G> element is greater than the first</li>
<li>0 if the second <G> element equals the first</li>
<li>-1 if the second <G> element is lower than the first</li>
Recursive sort of the given sequence using the given comparator.
The comparator must return :<ul>
<li>+1 if the second <G> element is greater than the first</li>
<li>0 if the second <G> element equals the first</li>
<li>-1 if the second <G> element is lower than the first</li>
Internal concatenation tool for recursive 'quickSort()' method
Operation equals
method equals(element : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::language::structure::Object
Overrides Object.equals(elt : Object)
Returns a Boolean stating whether the provided element is equal to
current Bag
Operation excluding
operation excluding(object : G) : kermeta::standard::Bag<G>
Returns a new Bag which content includes the content of the
current Bag from which all instances of object have been
removed
Operation flatten
operation flatten() : kermeta::standard::Bag<kermeta::standard::Object>
Returns a new Bag which content includes all non-Collection elements
of the current Set, and, for each Collection element of the current
Bag, as many elements as the Collection contains
Operation including
operation including(object : G) : kermeta::standard::Bag<G>
Returns a new Bag which content includes the content of the
current Bag and the element object
Operation intersection
Returns a new Bag corresponding to the intersection of elements
and the Bag
Operation intersectionWithSet
Returns a new Set corresponding to the intersection of a Set of
elements and the Bag
Operation removeFromOid
operation removeFromOid(elementOid : kermeta::standard::Integer) : Void
Removes the element identified by the provided Oid from the Bag
Operation removeOne
operation removeOne(element : G) : Void
Removes one instance of element from the Bag
Operation union
operation union(elements : kermeta::standard::Collection<G>) : kermeta::standard::Bag<G>
Returns a new Bag corresponding to the union of elements and
current Bag
Class Bag
kermeta::standard::Bag<G> inherits kermeta::standard::Collection<G>
Bag is a concrete non-ordered Collection allowing duplicates
@
Operation and
return self and other
Operation andThen
Short-circuit version of AND. This means that the function passed in parameter will be evaluated only if self is true
Note: we don't have a dedicated operator in the syntax for it yet so here is an example of use :
self.andThen{v | functionThatReturnABoolean() }
Operation equals
method equals(other : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::language::structure::Object
Returns true if
other
type is Booleanand has the same boolean value than current object.
Operation implies
return self implies other
http://en.wikipedia.org/wiki/Material_implication
meaning : (not self) or other
Operation nand
return self nand other
Operation or
return self or other
Operation orElse
Short-circuit version of OR. This means that the function passed in parameter will be evaluated only if self is false
Note: we don't have a dedicated operator in the syntax for it yet so here is an example of use :
self.orElse{v | functionThatReturnABoolean() }
Operation toString
method toString() : kermeta::standard::String from kermeta::language::structure::Object
Returns 'true' or 'false', depending on self value
Operation xor
return self xor other
Operation compareTo
method compareTo(other : kermeta::standard::Object) : kermeta::standard::Integer from kermeta::standard::Comparable
Comparaison
Operation equals
method equals(other : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::language::structure::Object
Returns true if
other
type is Characterand has the same letter value than current object.
Operation toString
method toString() : kermeta::standard::String from kermeta::language::structure::Object
Conversion from Character to String
Class Character
kermeta::standard::Character inherits kermeta::standard::ValueType, kermeta::standard::Comparable
The class Character
@
Operation add
operation add(element : G) : Void
Adds an element in the Collection (default implementation)
Operation addAll
operation addAll(elements : kermeta::standard::Collection<G>) : Void
Adds all elements from the Collection elements in the current Collection
Operation any
operation any() : G
Returns an element from the Collection
Raises an EmptyCollection exception if the Collection is empty
Operation asBag
operation asBag() : kermeta::standard::Bag<G>
Returns a new Bag built from the Collection
Operation asOrderedSet
operation asOrderedSet() : kermeta::standard::OrderedSet<G>
Returns a new OrderedSet built from the Collection
Operation asSequence
operation asSequence() : kermeta::standard::Sequence<G>
Returns a new Sequence built from the Collection
Operation asSet
operation asSet() : kermeta::standard::Set<G>
Returns a new Set built from the Collection
Operation clear
operation clear() : Void
Removes all elements from the Collection
Operation collect
operation collect<T>(collector : < G->T >) : kermeta::standard::Sequence<T>
Returns a new Sequence which content corresponds to the result
of running the collector function for each element of the Collection
The new collection size is the same as in the original collection, and which element types is the type of the result of the expression.
example :
aCollection2 := aCollection.collect { e | \/* put here an expression, for example e.name *\/ }
Operation contains
operation contains(element : G) : kermeta::standard::Boolean
Returns a Boolean stating whether the Collection contains at least one
instance of element, based on G.equals(elt : Object) definition
Note: for checking whether a physical element is contained by the collection,
make use of G.oid()
Operation containsAll
operation containsAll(elements : kermeta::standard::Collection<G>) : kermeta::standard::Boolean
Returns true if current Collection contains all elements of Collection elements
See Collection<G>.contains(Object)
Operation count
operation count(element : G) : kermeta::standard::Integer
Returns the number of instances of element in the Collection
Operation detect
operation detect(detector : < G->kermeta::standard::Boolean >) : G
Returns an element of the Collection (usually the first) for which the detector function
is not false
Returns void if no elements is validated by the detector function
example :
anObject := aCollection.detect { e | \/* a condition *\/} // returns an element that fulfill the condition.
Operation each
operation each(func : < G->kermeta::standard::Object >) : Void
Runs function func on each element of the Collection
example :
aCollection.each { e | \/* do something with each element e of this collection *\/ }
Operation empty
operation empty() : kermeta::standard::Boolean
Returns a Boolean stating whether the Collection is empty
Operation excludes
operation excludes(element : G) : kermeta::standard::Boolean
Returns true if the Collection does not contain element
Operation excludesAll
operation excludesAll(elements : kermeta::standard::Collection<G>) : kermeta::standard::Boolean
Returns true if the Collection contains no element of Collection elements
Operation exists
Returns a Boolean stating whether at least one element of the Collection
validates the condition specified by function func
example :
aBoolean := aCollection.exists { e | \/* a condition *\/} // returns true if at least one element fulfill the condition.
Operation existsCpl
Combinaison of exists on two elements in the collection
=> result := self.exists{x | self.exists {y | f(x,y)}}
Operation forAll
Returns a Boolean stating whether no element of the Collection invalidates
the condition specified by function func
example :
aBoolean := aCollection.forAll { e | \/* put here a condition *\/ } // return true if the condition is true for all elements in the collection.
Operation forAllCpl
Combinaison of ForAll on two elements in the collection
result := self.forAll{x | self.forAll {y | f(x,y)}}
(where x and y are 2 elements of the Collection)
typical use sample : ownedState.forAll{s1,s2| (s1.name==s2.name)implies(s1==s2)}
Operation includes
operation includes(element : G) : kermeta::standard::Boolean
OCL API alignment, doeas the same as contains
See Collection<G>.contains(Object)
Operation includesAll
operation includesAll(elements : kermeta::standard::Collection<G>) : kermeta::standard::Boolean
OCL API alignment, does the same as containsAll
See Collection<G>.containsAll(Collection<G>)
Operation indexedEach
operation indexedEach(func : < [G, kermeta::standard::EachContext]->kermeta::standard::Object >) : Void
Runs function func on each element of the Collection
the eachContext contains some information about the each process that can be used in the function,
for example the index represents the rank in the collection, start on 0
or boolean to indicates weither we are processing the first and/or the last element of the collection
note that this rank is relative to the processing order. this processing order is ensured only for sequence and ordered set
example :
aCollection.indexedEach { e, eachContext | \/* do something with each element e of this collection *\/ }
Operation isEmpty
operation isEmpty() : kermeta::standard::Boolean
OCL alignment API, does the same as empty
See Collection<G>.empty()
Operation isNotEmpty
operation isNotEmpty() : kermeta::standard::Boolean
OCL alignment API
Returns a Boolean stating whether the Collection contains at least
one element
See also Collection<G>.contains(Object)
Operation isUnique
operation isUnique<T>(collector : < G->T >) : kermeta::standard::Boolean
Returns a Boolean stating whether the the collector function evaluates to a
different value for each element of the Collection
example :
aCollection2 := aCollection.isUnique { e | \/* put here an expression that must be unique for all elements, for example e.name *\/ }
Operation iterator
operation iterator() : kermeta::standard::Iterator<G>
Returns an Iterator on the Collection
Operation one
operation one() : G
Returns an element from the Collection or void if the Collection is empty
Operation reject
Returns a new Sequence composed of elements of the Collection that
do not validate the rejector function
example :
aCollection2 := aCollection.reject { e |
\/* put here a condition that returns true for elements that must be exclude in the resulting Collection *\/
}
Operation remove
operation remove(element : G) : Void
Removes all instances of element from the Collection, based on
G.equals(Object) definition
Operation select
Returns a new Sequence composed of elements of the Collection that
validate the selector function
example :
aCollection2 := aCollection.select { e |
\/* put here a condition that returns true for elements that must be included in the resulting Collection *\/
}
Operation size
operation size() : kermeta::standard::Integer
Returns the number of elements in the Collection
Operation sum
operation sum() : G
Sum the element if they are summable (ie implement '+' operator by inheriting of the class Summable)
Class Collection
kermeta::standard::Collection<G> inherits kermeta::language::structure::Object
Collection is the root abstract class for all kermeta collections
@
Operation compareTo
operation compareTo(other : kermeta::standard::Object) : kermeta::standard::Integer
This method should be implemented by any class that inherits
from Comparable.
returns 0 if self = other
returns > 0 if self > other
returns < 0 if self < other
Operation isGreater
operation isGreater(other : kermeta::standard::Object) : kermeta::standard::Boolean
return true if self > other
Operation isGreaterOrEqual
operation isGreaterOrEqual(other : kermeta::standard::Object) : kermeta::standard::Boolean
return true if self >= other
Operation isLower
operation isLower(other : kermeta::standard::Object) : kermeta::standard::Boolean
return true if self < other
Operation isLowerOrEqual
operation isLowerOrEqual(other : kermeta::standard::Object) : kermeta::standard::Boolean
return true if self <= other
Class Comparable
kermeta::standard::Comparable inherits kermeta::language::structure::Object
The abstract class Comparable defines a set of operation
to compare instances of a class.
Sub-classes only has to implement abstract operation compareTo.
All other methods are defined w.r.t. the compareTo operation
@
Operation initialize
operation initialize(i : kermeta::standard::Integer, first : kermeta::standard::Boolean, last : kermeta::standard::Boolean) : kermeta::standard::EachContext
Undocumented
Class EachContext
kermeta::standard::EachContext inherits kermeta::language::structure::Object
context used in the indexedEach of Collection
@
Operation compareTo
method compareTo(other : kermeta::standard::Object) : kermeta::standard::Integer from kermeta::standard::Comparable
Comparison
Operation div
returns self / other
Operation equals
method equals(other : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::language::structure::Object
Returns true if
other
type is Integer or Realand has the same numeric value than current object.
Operation isGreater
method isGreater(other : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::standard::Comparable
return true if self > other
Operation isGreaterOrEqual
method isGreaterOrEqual(other : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::standard::Comparable
return true if self >= other
Operation isLower
method isLower(other : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::standard::Comparable
return true if self < other
Operation isLowerOrEqual
method isLowerOrEqual(other : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::standard::Comparable
return true if self <= other
Operation minus
returns self - other
Operation mod
returns self modulo other
Operation mult
returns self * other
Operation plus
method plus(other : kermeta::standard::Integer) : kermeta::standard::Integer from kermeta::standard::Summable
returns self + other
Operation times
operation times(body : < kermeta::standard::Integer->kermeta::standard::Object >) : Void
Iteration
Operation toString
method toString() : kermeta::standard::String from kermeta::language::structure::Object
Numeric value in string format
Class Integer
kermeta::standard::Integer inherits kermeta::standard::Numeric, kermeta::standard::Summable<kermeta::standard::Integer>
The class Integer
@
Operation hasNext
operation hasNext() : kermeta::standard::Boolean
Returns true if the iterator has a next element
Operation isOff
operation isOff() : kermeta::standard::Boolean
Returns true if the iterator is on the last element
i.e. returns not self.hasNext()
Operation next
operation next() : G
Returns the next element of the iterator
Raises IteratorIsOff exception in case the iterator is on the last element
Class Iterator
kermeta::standard::Iterator<G> inherits kermeta::language::structure::Object
Iterator to be used with Collection
See also Collection<G>.getIterator()
@
Class NotComparableException
kermeta::standard::NotComparableException inherits kermeta::exceptions::Exception
raised when two objects are not comparable
@
Class Numeric
kermeta::standard::Numeric inherits kermeta::standard::Comparable, kermeta::standard::ValueType
The abstract class Numeric is the root class for all
numeric types
@
Alias Object
kermeta::standard::Object
@
Operation addAt
operation addAt(index : kermeta::standard::Integer, element : G) : Void
Adds element in the OrderedCollection at rank index
Raises IndexOutOfBound exception if provided index is lower than 0 or
larger than the size of the OrderedCollection
Operation elementAt
operation elementAt(index : kermeta::standard::Integer) : G
Returns the element at rank index in the OrderedCollection
Raises IndexOutOfBound exception if provided index is lower than 0 or
larger than the size of the OrderedCollection
Operation equals
method equals(element : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::language::structure::Object
Overrides Object.equals(Object)
Returns a Boolean stating whether the provided element is equal to
current OrderedCollection
Operation first
operation first() : G
Returns the first element in the OrderedCollection
Raises an EmptyCollection exception if the OrderedCollection is empty
Operation indexOf
operation indexOf(element : G) : kermeta::standard::Integer
Returns the index of the first instance of element in the OrderedCollection
or -1 if the element is not contained by the OrderedCollection
Raises an EmptyCollection exception if the OrderedCollection is empty
Operation last
operation last() : G
Returns the last element in the OrderedCollection
Raises an EmptyCollection exception if the OrderedCollection is empty
Operation removeAt
operation removeAt(index : kermeta::standard::Integer) : Void
Removes the element at rank index from the OrderedCollection
Raises IndexOutOfBound exception if provided index is lower than 0 or
larger than the size of the OrderedCollection
Class OrderedCollection
kermeta::standard::OrderedCollection<G> inherits kermeta::standard::Collection<G>
An OrderedCollection is the root abstract class for all ordered Collections.
@
Operation add
method add(element : G) : kermeta::standard::Void from kermeta::standard::Set
See Set<G>.add(G)
Operation addAt
method addAt(index : kermeta::standard::Integer, element : G) : Void from kermeta::standard::OrderedCollection
Overrides OrderedCollection<G>.addAt(Integer, G)
Adds element in the OrderedSet at rank index if the ordered set does
not already contain the element, does nothing otherwise
Operation append
operation append(element : G) : kermeta::standard::OrderedSet<G>
Builds and returns a new OrderedSet from current one with element
inserted in head
Operation at
operation at(index : kermeta::standard::Integer) : G
Returns element at rank index in the sequence
Raises IndexOutOfBound exception if provided index is lower than 0 or
larger than the size of the OrderedSet
Operation equals
method equals(element : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::standard::OrderedCollection
See OrderedCollection<G>.equals(Object)
Operation insertAt
operation insertAt(index : kermeta::standard::Integer, subject : G) : kermeta::standard::OrderedSet<G>
Builds and returns a new OrderedSet from current one with element
inserted at rank index
Operation preppend
operation preppend(element : G) : kermeta::standard::OrderedSet<G>
Builds and returns a new OrderedSet from current one with element
inserted in tail
Operation subSet
operation subSet(min : kermeta::standard::Integer, max : kermeta::standard::Integer) : kermeta::standard::OrderedSet<G>
Builds and returns a new OrderedSet composed of elements of current ordered
set from rank min to rank max (order is respected)
Raises IndexOutOfBound exception if min is negative, max is larger than
the size of the ordered set or min is larger than max
Class OrderedSet
kermeta::standard::OrderedSet<G> inherits kermeta::standard::Set<G>, kermeta::standard::OrderedCollection<G>
An OrderedSet is a Set that contained ordered distinct elements
@
Operation compareTo
method compareTo(other : kermeta::standard::Object) : kermeta::standard::Integer from kermeta::standard::Comparable
Comparison
Operation div
returns self / other
Operation equals
method equals(other : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::language::structure::Object
Returns true if
other
type is Integer or Realand has the same numeric value than current object.
Operation minus
returns self - other
Operation mult
returns self * other
Operation plus
method plus(other : kermeta::standard::Real) : kermeta::standard::Real from kermeta::standard::Summable
returns self + other
Operation toString
method toString() : kermeta::standard::String from kermeta::language::structure::Object
Returns numeric value in string format
Class Real
kermeta::standard::Real inherits kermeta::standard::Numeric, kermeta::standard::Summable<kermeta::standard::Real>
class Real
@
Operation append
operation append(element : G) : kermeta::standard::Sequence<G>
Builds and returns a new Sequence from current one with element
inserted in head
Operation at
operation at(index : kermeta::standard::Integer) : G
Returns element at rank index in the sequence
Raises IndexOutOfBound exception if provided index is lower than 0 or
larger than the size of the Sequence
Operation equals
method equals(element : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::standard::OrderedCollection
Overrides OrderedCollection<G>.equals(Object)
Returns a Boolean stating whether the provided element is equal to
current Sequence
Operation insertAt
operation insertAt(index : kermeta::standard::Integer, element : G) : kermeta::standard::Sequence<G>
Builds and returns a new Sequence from current one with element
inserted at rank index
Operation preppend
operation preppend(element : G) : kermeta::standard::Sequence<G>
Builds and returns a new Sequence from current one with element
inserted in tail
Operation subSequence
operation subSequence(min : kermeta::standard::Integer, max : kermeta::standard::Integer) : kermeta::standard::Sequence<G>
Builds and returns a new Sequence composed of elements of current sequence
from rank min to rank max (order is respected)
Raises IndexOutOfBound exception if min is negative, max is larger than
the size of the sequence or min is larger than max
Class Sequence
kermeta::standard::Sequence<G> inherits kermeta::standard::Bag<G>, kermeta::standard::OrderedCollection<G>
A Sequence is an OrderedCollection of elements allowing duplicates
@
Operation add
method add(element : G) : Void from kermeta::standard::Collection
Overrides Collection<G>.add(G)
Adds elt to the Set if it is not already contained by the
Set, does nothing otherwise
Operation asBag
method asBag() : kermeta::standard::Bag<G> from kermeta::standard::Collection
Overrides Collection<G>.asBag()
Returns a new Bag composed of all elements of current Set
Operation asOrderedSet
method asOrderedSet() : kermeta::standard::OrderedSet<G> from kermeta::standard::Collection
Overrides Collection<G>.asOrderedSet()
Returns a new OrderedSet that contains all elements of current Set
Operation asSequence
method asSequence() : kermeta::standard::Sequence<G> from kermeta::standard::Collection
Overrides Collection<G>.asSequence()
Returns a new Sequence composed of all elements of current Set
Operation asSet
method asSet() : kermeta::standard::Set<G> from kermeta::standard::Collection
Overrides Collection<G>.asSet()
Returns a new Set composed of all elements of current Set
Operation concatenate
operation concatenate(less : kermeta::standard::OrderedSet<G>, pivot : kermeta::standard::OrderedSet<G>, greater : kermeta::standard::OrderedSet<G>) : kermeta::standard::OrderedSet<G>
Returns a ordered set of the bag elements sorted using the given comparator.
The comparator must return :<ul>
<li>+1 if the second <G> element is greater than the first</li>
<li>0 if the second <G> element equals the first</li>
<li>-1 if the second <G> element is lower than the first</li>
Recursive sort of the given (ordered) set using the given comparator.
The comparator must return :<ul>
<li>+1 if the second <G> element is greater than the first</li>
<li>0 if the second <G> element equals the first</li>
<li>-1 if the second <G> element is lower than the first</li>
Internal concatenation tool for recursive 'quickSort()' method
Operation equals
method equals(element : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::language::structure::Object
Overrides Object.equals(Object)
Returns a Boolean stating whether the provided element is equal to
current Set
Operation flatten
operation flatten() : kermeta::standard::Set<kermeta::standard::Object>
Returns a new Set which content includes all non-Collection elements
of the current Set, and, for each Collection element of the current
Set, as many elements as the Collection contains
Duplicates are removed
Operation intersection
operation intersection(elements : kermeta::standard::Collection<G>) : kermeta::standard::Set<G>
Returns a new Set corresponding to the intersection of the Set elements
with the current Set
Operation minus
Returns a new Set corresponding to the difference between the
current Set and the Set elements, ie all elements contained by
the current Set that do not appear in the elements Set
Operation remove
method remove(element : G) : Void from kermeta::standard::Collection
Overrides Collection<G>.remove(G)
Removes the element from the Set if it is contained by the Set
Operation symmetricDifference
Returns a new Set which contents corresponds to the symmetric
difference between current Set and Set s, ie all elements of
each Set that do not appear in the other one
Operation union
Returns a new Set corresponding to the union of the Set elements
with the current Set
Operation unionWithBag
Returns a new Bag corresponding to the union of the Bag elements
with the current Set
Class Set
kermeta::standard::Set<G> inherits kermeta::standard::Collection<G>
A Set is a non-ordered collection that contains distinct elements
(with regards to the G.equals(Object) operation)
@
Operation append
operation append(other : kermeta::standard::String) : Void
Appends other at the end of self
A more efficient method is kermeta::utils::StringBuffer::append(other)
Operation compareTo
method compareTo(other : kermeta::standard::Object) : kermeta::standard::Integer from kermeta::standard::Comparable
Comparaison
Operation contains
Return if a string is contained by another string
Operation elementAt
returns the character at index in the String
Operation equals
method equals(other : kermeta::standard::Object) : kermeta::standard::Boolean from kermeta::language::structure::Object
Returns true if
other
type is Stringand has the same string value than current object.
Operation indexOf
returns the index within this string of the first
occurrence of the specified substring
Operation plus
method plus(other : kermeta::standard::String) : kermeta::standard::String from kermeta::standard::Summable
returns a new string self + other
Operation replace
operation replace(str1 : kermeta::standard::String, str2 : kermeta::standard::String) : kermeta::standard::String
Replaces all occurences of str1 in the current string by the string str2
Operation size
operation size() : kermeta::standard::Integer
returns the number of characters in the current String
Operation split
operation split(delimiter : kermeta::standard::String) : kermeta::standard::Sequence<kermeta::standard::String>
Return of an ordered set of the splitted string
Note that the delimiter is a regular expression (as the split operation in java)
Operation substring
operation substring(startIndex : kermeta::standard::Integer, endIndex : kermeta::standard::Integer) : kermeta::standard::String
returns a new string that is a substring of this string
takes as parameters : the startIndex and endIndex
Operation toBoolean
operation toBoolean() : kermeta::standard::Boolean
Parses the current string and returns true if the string is "true" and false if the string is "false"
The parsing is not case sensitive and if no boolean value is recognized then a StringFormatException is raised.
Operation toInteger
operation toInteger() : kermeta::standard::Integer
Parses the current string into an integer.
if no integer value is recognized then a StringFormatException is raised.
Operation toLowerCase
operation toLowerCase() : kermeta::standard::String
Return the current string in lower case
Operation toReal
operation toReal() : kermeta::standard::Real
Parses the current string into a real.
if no real value is recognized then a StringFormatException is raised.
Operation toString
method toString() : kermeta::standard::String from kermeta::language::structure::Object
returns the string itself
Operation toUpperCase
operation toUpperCase() : kermeta::standard::String
Return the current string in upper case
Class String
kermeta::standard::String inherits kermeta::standard::ValueType, kermeta::standard::Comparable, kermeta::standard::Summable<kermeta::standard::String>
The class String
@
Operation plus
operation plus(other : G) : G
Summarization method to be implemented by any summable class.
The parameter must have the same type (or one of its subtypes)
than the current object .
Class Summable
kermeta::standard::Summable<G> inherits kermeta::language::structure::Object
The abstract class Summable defines a set of operation
to sum instances of a class.
Sub-classes only has to implement abstract operation plus.
@
Operation toString
method toString() : kermeta::standard::String from kermeta::language::structure::Object
NOT IMPLEMENTED
Class UnknownJavaObject
kermeta::standard::UnknownJavaObject inherits kermeta::language::structure::Object
This special object is used to represent java objects that cannot be concretely used with kermeta
the only actions possible on these objects are : assignment and passing them as parameter
@
Alias UnlimitedNatural
kermeta::standard::UnlimitedNatural
Unlimited natural is used for reflection.
It is mapped to integer.equals().
Any negative number is interpreted as '*'
@
Class ValueType
kermeta::standard::ValueType inherits kermeta::language::structure::Object
The abstract class ValueType does not contain any feature.
However, any instance of a sub-class of ValueType will be passed by value
instead of by reference for any other objects.
that means that each time you := such object it will call the clone function associated to it (Not implemented yet except for Integer, String and boolean!!!)
@
Operation isInstanceOf
method isInstanceOf(type : kermeta::language::structure::Type) : kermeta::standard::Boolean from kermeta::language::structure::Object
Returns true
Operation isVoid
method isVoid() : kermeta::standard::Boolean from kermeta::language::structure::Object
Return true
Operation toString
method toString() : kermeta::standard::String from kermeta::language::structure::Object
Returns the String identifier '<void>'
Class Void
kermeta::standard::~Void inherits kermeta::language::structure::Object
The class Void
By convention it is a sub-type of everything
@
Package utils
kermeta::utils
Contains special classes (Hashtable, Stack) that are not contained in Kermeta
metamodel
Contains special classes (Hashtable, Stack) that are not contained in Kermeta
metamodel
Operation clear
operation clear() : Void
Removes all elements from the Hashtable
Operation containsKey
operation containsKey(key : K) : kermeta::standard::Boolean
Returns a Boolean stating whether a key is present or not in this Hashtable
Operation getValue
operation getValue(key : K) : V
Returns the value for key 'key' if it exists, otherwise returns Void
Operation keyIterator
operation keyIterator() : kermeta::standard::Iterator<K>
Returns an iterator over the Keys of this Hashtable
Operation keys
operation keys() : kermeta::standard::Set<K>
Returns a set containing the hash keys of this Hashtable
Operation put
operation put(key : K, ~value : V) : Void
Adds a entry into the Hashtable
Operation remove
operation remove(key : K) : Void
Removes the entry with key equals to 'key'
Operation valueIterator
operation valueIterator() : kermeta::standard::Iterator<V>
Returns an iterator over the values of this Hashtable
Operation values
operation values() : kermeta::standard::Collection<V>
Returns a collection containing the elements of this Hashtable
Class Hashtable
kermeta::utils::Hashtable<K, V> inherits kermeta::language::structure::Object
An implementation of hashtable
This implementation is for speed optimisation it cannot be serialized.
If your wish to serialize its content you need to copy its content into a classical ecore structure (attribute or references)
@
Operation peek
operation peek() : G
Gets the element at the top of the stack
Operation pop
operation pop() : G
Get and remove the element at the top of the stack
Operation push
operation push(element : G) : Void
Pushes an element into the stack
Class Stack
kermeta::utils::Stack<G> inherits kermeta::standard::Sequence<G>
An implementation of stack
@
Operation append
operation append(arg0 : kermeta::standard::String) : kermeta::utils::StringBuffer
Append a given string at the end of this StringBuffer
@param arg0 A string to append at the end of this StringBuffer
@return A reference to this object
Operation length
operation length() : kermeta::standard::Integer
Return the length of the StringBuffer
@return length of the StringBuffer
Operation toString
method toString() : kermeta::standard::String from kermeta::language::structure::Object
Convert this StringBuffer to String and return its value
@return The string value of this StringBuffer
Class StringBuffer
kermeta::utils::StringBuffer inherits kermeta::language::structure::Object
This class mimic the behavior of the java's StringBuffer class. This enables better performance in long
string concatenation.<br>
Only work on Strings
@
Package xmltype
kermeta::xmltype
Contains the definition of a Kermeta classes used for compatibility with XMLType.ecore
Class QName
kermeta::xmltype::QName inherits kermeta::standard::String
Kermeta representation of EMF type::QName from XMLType.ecore
@
Package persistence
kermeta::persistence
Contains the classes that handle the serialization of models, in particular
EMF models.
Operation toString
method toString() : kermeta::standard::String from kermeta::language::structure::Object
user friendly message build with those informations
Property danglingElement
reference danglingElement: kermeta::standard::Object
Element that is not contained by a resource in the repository
Property referencingElement
reference referencingElement: kermeta::standard::Object
Element that has a reference to the dangling element
Property referencingProperty
reference referencingProperty: kermeta::language::structure::Property
Property used to reference the dangling element
Class DanglingDiagnostic
kermeta::persistence::DanglingDiagnostic inherits kermeta::language::structure::Object
class used to gather the information required to make a user friendly report about a dangling element
(see. findDanglingModelElements())
@
Operation createResource
method createResource(uri : kermeta::standard::String, mm_uri : kermeta::standard::String) : kermeta::persistence::Resource from kermeta::persistence::Repository
Overrides Repository.createResource(String, String)
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 registerEcoreFile
operation registerEcoreFile(mm_uri : kermeta::standard::String) : Void
Register the content of the given ecore file into EMF registry
Once registered, EMF will be able to load and save models conformant to this ecore file
Warning: if the NSURI you wish to register is already, registered (either statically or due to a previous call)
it will do nothing. Ie. modification in the ecore file will not be taken into account unless you manually unregister it.
Property ignoreAllLoadErrors
attribute ignoreAllLoadErrors: kermeta::standard::Boolean
When loading the Resources,
if there are some errors while loading some objects, the loader can try to ignore them
setting this attribute to true is equivalent to setting ignoreLoadErrorUnknownMetaclass and ignoreLoadErrorUnknownProperty to true
by default, not setting this attribute is considered as false.
Property ignoreLoadErrorUnknownMetaclass
attribute ignoreLoadErrorUnknownMetaclass: kermeta::standard::Boolean
When loading the Resources,
if there are some errors due to an unknown metaclass while loading some objects, the loader try to ignore them
by default, not setting this attribute is considered as false.
Property ignoreLoadErrorUnknownProperty
attribute ignoreLoadErrorUnknownProperty: kermeta::standard::Boolean
When loading the Resources,
if there are some errors due to an unknown property while loading some objects (ie. the metaclass is known but it cannot retreive
the given reference or attribute in the ClassDefinition, the loader try to ignore them
by default, not setting this attribute is considered as false.
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 useful 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::standard::Set
Overrides Set<Object>.add(Object)
Add an instance to the Resource
Ensures that the instance is referenced by a one and only one Resource of the same Repository
Ensures that the instance does not appear more than once in the Resource
Operation load
method load() : Void from kermeta::persistence::Resource
Overrides Resource.load()
In case the metamodelURI was not previously set, metamodelURI is filled with
the nsuri of the root package of the metamodel used to load the Resource after
a successful load
Operation mark
Undocumented
Operation remove
method remove(instance : kermeta::standard::Object) : Void from kermeta::standard::Set
Overrides Set<Object>.remove(Object)
Remove the instance from the Resource
Operation save
method save() : Void from kermeta::persistence::Resource
Overrides Resource.save()
Operation saveAndValidateWithEMF
operation saveAndValidateWithEMF() : kermeta::standard::Boolean
Checks the Resource using the EMF validation function, and saves it if
validation succeeds
Applies validation to all root objects of the Resource
Returns true if the validation reports no error, raises exceptions otherwise
Operation saveWithNewURI
method saveWithNewURI(new_uri : kermeta::standard::String) : Void from kermeta::persistence::Resource
Overrides Resource.saveWithNewURI(String)
Class EMFResource
kermeta::persistence::EMFResource inherits kermeta::persistence::Resource
@
Extension of the Resource class definition that is specific to EMF Repository.
User is not supposed to directly create it. Otherwise it will not be correctly initialized
You must To create one
@
Extension of the Resource class definition that is specific to EMF Repository.
User is not supposed to directly create it. Otherwise it will not be correctly initialized
You must To create one
@
Operation createResource
operation createResource(uri : kermeta::standard::String, mm_uri : kermeta::standard::String) : kermeta::persistence::Resource
Creates a new Resource with given uri, and an optional mm_uri
mm_uri is required when creating a new model from scratch.
Raises a ResourceCreate exception in case the Repository already
contains a Resource with the given uri
If uri does not points to an existing model file (in the case of
a model creation), calls to load() operation will fail as long as
the model has not been saved once
Operation findDanglingModelElements
operation findDanglingModelElements() : kermeta::standard::Set<kermeta::persistence::DanglingDiagnostic>
Search for elements referenced by one element contained by this repository that are not contained by this repository
ie. element that EMF would claim as "not contained in a resource"
example of use :
var report : Set<DanglingDiagnostic>
report := repository.findDanglingModelElements()
report.each{ diag | stdio.writeln(diag.toString ) }
Operation getResource
Returns the Resource associated with the given uri if this uri is associated with
an already created Resource of the Repository.
If the Repository contains no Resource associated with the given uri, creates
a new Resource and loads it.
In order to prevent multiple load of the same file by using variant path to the same file, all URI used by this function are normalized
Raises a ResourceCreate exception if the given uri does not point to an existing
model file
May also raises loading exceptions if this is the first retrieval of the resource
Operation normalizeUri
Return a normalized version of the Uri
in order to prevent several loading of the same file because they have different path that leads to them, kermeta uses normalizedURI
for some of its functions (eg. repository.getResource )
As EMF needs URI of the form platform:/resource or platform:/plugin, kermeta automatically
normalize the uri when loading or saving. This is especially true for file:/ uri or relative uri (./ or / )
If you wish to know what concrete uri is used by kermeta when loading and saving you can use this function
to check how a given uri is normalized by kermeta
Property resources
attribute resources: set kermeta::persistence::Resource[0..*]#repository
Resources created by this Repository
This feature is supposed read only, otherwise it cannot garantee that an element is contained by only
one Resource of a given Repository
Class Repository
kermeta::persistence::Repository inherits kermeta::language::structure::Object
Abstract resource container, that contains a list of available loaded resources,
and methods to create or get a resource given an URI.
A repository cannot contain 2 resources which points to the same file (ie. that have the same normalizedURI)
@
Operation findDanglingModelElements
operation findDanglingModelElements() : kermeta::standard::Set<kermeta::persistence::DanglingDiagnostic>
Search for elements referenced by one element contained by this resource that are not contained by this repository
ie. element that EMF would claim as "not contained in a resource"
checks only objects directly referenced by the element in this resource, ignores indirectly referenced objects
example of use :
var report : Set<DanglingDiagnostic>
report := resource.findDanglingModelElements()
report.each{ diag | stdio.writeln(diag.toString ) }
Operation instances
operation instances() : kermeta::persistence::Resource
The entities contained in the model-instance, that are provided when user loads a resource
instances == rootContents
this is a loop on Resource itself in order to get backward compatibility
@
Operation load
operation load() : Void
Loads the Resource, thus making content of the Resource browsable.
Raises a ResourceLoadException in case loaded Resource is empty
Operation normalizedUri
operation normalizedUri() : kermeta::standard::String
Return a normalized version of the Uri of this resource
in order to prevent several loading of the same file because they have different path that leads to them, kermeta uses normalizedURI
for some of its functions (eg. repository.getResource )
As EMF needs URI of the form platform:/resource or platform:/plugin, kermeta automatically
normalize the uri when loading or saving. This is especially true for file:/ uri or relative uri (./ or / )
If you wish to know what concrete uri is used by kermeta when loading and saving you can use this function
to check how a given uri is normalized by kermeta
Operation save
operation save() : Void
Save a Resource in the file specified by the current value of uri
Operation saveWithNewURI
operation saveWithNewURI(new_uri : kermeta::standard::String) : Void
Save a Resource in a file referenced by the new uri.
note: this doesn't change the URI of the resource, it is only saved in another place
Property contents
property contents: set kermeta::standard::Object[0..*] readonly
Returns the set of all Objects directly or indirectly contained by the Resource,
or an empty set if the Resource is empty
implementation note: since this derived property build a set, it guarantees the unicity, as a drawback,
calling this property on large resources will be really slow due to this verification. some user may prefer
to reimplement it using a bag.
Property dependentResources
property dependentResources: set kermeta::persistence::Resource[0..*] readonly
Returns the set of Resources the current Resource, which must have been loaded,
depends on, an empty set if current Resource has no dependency
Property isReadOnly
attribute isReadOnly: kermeta::standard::Boolean
Indicates weither this resource will be updated when saving the repository
This is useful if the repository contains some metamodels that should not be saved.
Note that in the current version, it doesn't ensure that you have not modified its content (using the freeze)
If you modify the elements of such resource, other resource that depend on it will be incorrectly saved
Property metaModelURI
attribute metaModelURI: kermeta::standard::String
Uri of the meta-model of the Resource to load
Property repository
reference repository: kermeta::persistence::Repository#resources
Repository used to create the Resource
This feature is supposed read only, otherwise it cannot garantee that an element is contained by only
one Resource of a given Repository
Class Resource
kermeta::persistence::Resource inherits kermeta::standard::Set<kermeta::standard::Object>
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?
@
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 @
Property constraintAppliedTo
reference constraintAppliedTo: kermeta::standard::Object
Object on which the constraint was applied to
On Invariant, we can generally consider this object as the faulty Object
On Invariant, we can generally consider this object as the faulty Object
Property failedConstraint
reference failedConstraint: kermeta::language::structure::Constraint
constraint that has failed
Class ConstraintViolatedException
kermeta::exceptions::ConstraintViolatedException inherits kermeta::exceptions::Exception
Common super class for all ConstraintVioloated exceptions @
Class ConstraintViolatedInv
kermeta::exceptions::ConstraintViolatedInv inherits kermeta::exceptions::ConstraintViolatedException
An invariant isn't satisfied on a given Object @
Class ConstraintViolatedPost
kermeta::exceptions::ConstraintViolatedPost inherits kermeta::exceptions::ConstraintViolatedException
The post-condition is not satisfied @
Class ConstraintViolatedPre
kermeta::exceptions::ConstraintViolatedPre inherits kermeta::exceptions::ConstraintViolatedException
The pre-condition is not satisfied @
Operation add
operation add(cons : kermeta::exceptions::ConstraintViolatedInv) : kermeta::standard::Void
Undocumented
Operation prettyPrint
operation prettyPrint() : Void
Undocumented
Property setConstraints
attribute setConstraints: kermeta::standard::Bag<kermeta::exceptions::ConstraintViolatedInv>
Undocumented
Class ConstraintsDiagnostic
kermeta::exceptions::ConstraintsDiagnostic inherits kermeta::language::structure::Object
@
Class DivisionByZero
kermeta::exceptions::DivisionByZero inherits kermeta::exceptions::Exception
well-known attempt to divide with a zero valued divider @
Class DynamicExpressionException
kermeta::exceptions::DynamicExpressionException inherits kermeta::exceptions::Exception
to be written #########################################
@
Class EmptyCollection
kermeta::exceptions::EmptyCollection inherits kermeta::exceptions::Exception
Occurs when trying to access element on an empty collection @
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 inherits kermeta::language::structure::Object
Generic exceptions
The main class from which all the exception inherit
@
Class FileNotFoundException
kermeta::exceptions::FileNotFoundException inherits kermeta::exceptions::IOException
the file has not be found on the underlying system @
Class IOException
kermeta::exceptions::IOException inherits kermeta::exceptions::Exception
an interaction with the underlying system failed @
Class IncompatibleTypeError
kermeta::exceptions::IncompatibleTypeError inherits kermeta::exceptions::RuntimeError
Raised by the Object::set operation if the type of the
Object to set has an incompatible type.
@
Class IndexOutOfBound
kermeta::exceptions::IndexOutOfBound inherits kermeta::exceptions::Exception
Occurs when trying to access out of bounds elements @
Class IteratorIsOff
kermeta::exceptions::IteratorIsOff inherits kermeta::exceptions::Exception
Occurs when calling next() operation while iterator is already
positioned on the last element of a collection
@
Class NotImplementedException
kermeta::exceptions::NotImplementedException inherits kermeta::exceptions::RuntimeError
Use this exception when you want to forbid the access to an unimplemented operation
and invite to implement it
@
Class OverflowError
kermeta::exceptions::OverflowError inherits kermeta::exceptions::Exception
the figure oversteps the capacity of the numeric variable @
Class ResourceCreateException
kermeta::exceptions::ResourceCreateException inherits kermeta::exceptions::Exception
Occurs when trying to crate a Resource already existing in the Repository @
Class ResourceLoadException
kermeta::exceptions::ResourceLoadException inherits kermeta::exceptions::Exception
Occurs when Resource loading fails for some reasons @
Class ResourceMixedLevelsException
kermeta::exceptions::ResourceMixedLevelsException inherits kermeta::exceptions::ResourceSaveException
Occurs when Resource saving fails because an object refers to an element which
belongs to the Definition of the currently running program @
belongs to the Definition of the currently running program @
Property failedWhileSaving
reference failedWhileSaving: kermeta::standard::Object
Object on which the the saved failed
One can rescue the exception and analyse the structure next to this object,
this can give some clue about the faulty structure
One can rescue the exception and analyse the structure next to this object,
this can give some clue about the faulty structure
Class ResourceSaveException
kermeta::exceptions::ResourceSaveException inherits kermeta::exceptions::Exception
Occurs when Resource saving fails for some reasons @
Class ResourceUnconformityException
kermeta::exceptions::ResourceUnconformityException inherits kermeta::exceptions::Exception
Raised when user tries to add an object that is not conform to the metamodel @
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 StringFormatException
kermeta::exceptions::StringFormatException inherits kermeta::exceptions::Exception
to be written #########################################
@
Class StringIndexOutOfBound
kermeta::exceptions::StringIndexOutOfBound inherits kermeta::exceptions::Exception
the data overstep the size of the string variable @
Class TypeCastError
kermeta::exceptions::TypeCastError inherits kermeta::exceptions::RuntimeError
Occurs when a cast (Object::asType operation) fails
@
Class UnregisteredMetamodelException
kermeta::exceptions::UnregisteredMetamodelException inherits kermeta::exceptions::Exception
Raised when a resource cannot be loaded or saved because the URI used for
the metamodel is not registered
@
the metamodel is not registered
@
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 *)
@
Class VoidOperandError
kermeta::exceptions::VoidOperandError inherits kermeta::exceptions::Exception
one of the required operands is void @
Package io
kermeta::io
Contains file input/output related classes.
Contains standard input/output related classes.
Operation readTextFile
Reads a text file
Operation writeTextFile
operation writeTextFile(filename : kermeta::standard::String, text : kermeta::standard::String) : Void
Writes a String in a text file
Operation writeTextFileWithEncoding
operation writeTextFileWithEncoding(filename : kermeta::standard::String, text : kermeta::standard::String, encoding : kermeta::standard::String) : Void
Writes a String in a text file by using a specific encoding
Class FileIO
kermeta::io::FileIO inherits kermeta::language::structure::Object
Implementation of simple helpers to read ans write text files
@
Operation error
operation error(object : kermeta::standard::String) : Void
Writes the object to error output
Operation errorln
operation errorln(object : kermeta::standard::String) : Void
Writeln the object to error output
Operation read
Reads a String from standard input
Operation write
operation write(object : kermeta::standard::String) : Void
Writes 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 inherits kermeta::language::structure::Object
An implementation of StdIO : standard input/output
@
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() : kermeta::standard::Void
Initializes the formalParameters with an empty set of parameters
and the self type with void
Operation parse
Parse the expression as a string
and updates the expression field and errors
Returns true if the expression was parsed sucessfuly
Property errors
reference errors: kermeta::interpreter::KermetaError[0..*]
Parse errors and type errors
Property formalParameters
reference formalParameters: kermeta::utils::Hashtable<kermeta::standard::String, kermeta::language::structure::Type>
Formal parameters of the expression (bindings between parameters' names and types)
Property selfClass
reference selfClass: kermeta::language::structure::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 inherits kermeta::language::structure::Object
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 KermetaError
kermeta::interpreter::KermetaError inherits kermeta::language::structure::Object
Kermeta language error in a code written in Kermeta
@
Class ParseError
kermeta::interpreter::ParseError inherits kermeta::interpreter::KermetaError
Kermeta error for parsing problems
@
Class TypeError
kermeta::interpreter::TypeError inherits kermeta::interpreter::KermetaError
Type errors in a code written in Kermeta
@
Package ecore
kermeta::ecore
Contains the definition of a Kermeta classes used for compatibility with Ecore
Property eStructuralFeatureName
attribute eStructuralFeatureName: kermeta::standard::String
Undocumented
Class EFeatureMapEntry
kermeta::ecore::EFeatureMapEntry inherits kermeta::language::structure::Object
Kermeta representation of EMF EFeatureMapEntry
it contains the name of the required feature and the actual value
@