Main Page/Resources/MTBenchmark/JavaQueries

From Atenea

Jump to: navigation, search


Java Queries

The JavaQuery case study was proposed in the Transformation Tool Contest (TTC) 2009 for supporting reverse engineering [1].

With this case study we have incorporated to our benchmark a large metamodel with complex inheritance structures and package definitions that represents a more realistic example than the rest of (rather) simple metamodels used in the rest of the test cases, and hence a more realistic scenario.

Another interesting characteristic of this case study is that the transformation has a rule with a complex filter from which several helpers are called.


Input metamodel

Download JDTAST.ecore or show JDTAST.ecore tree view

Output metamodel

Download View.ecore or show View.ecore tree view



As an example, in the following we show the ATL transformation for this case study. The code can be downloaded from here.

module Q1;
create OUT: MM1 from IN: MM;
helper context MM!TypeDeclaration def: methodsWithReturnType : Sequence(MM!MethodDeclaration) =
   self.bodyDeclarations -> select( e | e.oclIsKindOf (MM!MethodDeclaration)) -> select (e | not e.returnType.oclIsUndefined())
helper context MM!BodyDeclaration def: isPublic : Boolean =
   self.modifiers -> select (m | m.oclIsTypeOf (MM!Modifier)) -> exists (m | m.public)   
helper context MM!BodyDeclaration def: isStatic : Boolean =
   self.modifiers -> select (m | m.oclIsTypeOf (MM!Modifier)) -> exists (m | m.static)   
rule Q1 {
      s: MM!TypeDeclaration (s.methodsWithReturnType
           -> select (e | e.isPublic) -> select (e | e.isStatic)
           -> select (e | e.returnType.oclIsKindOf(MM!QualifiedType) or 
           -> exists (e | =
      v_class: MM1!Class (
         name <-

Input models

The input models can be downloaded from this link provided by the authors of the TTC case study.


[1] Sottet, J.S., Jouault, F.: Program comprehension. Proc. 5th Int. Workshop on Graph-Based Tools (2009)

Personal tools