Skip to content

Commit

Permalink
Define mapping language between two ModelTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
fcoulon committed Mar 23, 2015
1 parent 6950e92 commit 3534f44
Show file tree
Hide file tree
Showing 16 changed files with 1,786 additions and 2 deletions.
Expand Up @@ -11,5 +11,8 @@ Export-Package: fr.inria.diverse.melange.metamodel.melange,
fr.inria.diverse.melange.metamodel.melange.impl,
fr.inria.diverse.melange.metamodel.melange.util
Require-Bundle: org.eclipse.emf.codegen.ecore;visibility:=reexport,
org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.xtext.common.types;visibility:=reexport,
org.eclipse.xtext.xbase;bundle-version="[2.7.0,2.8.0)";visibility:=reexport
Bundle-ActivationPolicy: lazy
16 changes: 16 additions & 0 deletions plugins/fr.inria.diverse.melange.metamodel/model/Melange.ecore
Expand Up @@ -77,4 +77,20 @@
<eClassifiers xsi:type="ecore:EClass" name="ModelingElement" abstract="true" eSuperTypes="#//Element">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="ecoreUri" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Mapping" eSuperTypes="#//Element">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="from" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="to" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="rules" upperBound="-1"
eType="#//ClassBinding" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ClassBinding">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="from" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="to" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="properties" upperBound="-1"
eType="#//PropertyBinding" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="PropertyBinding">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="from" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="to" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>
14 changes: 14 additions & 0 deletions plugins/fr.inria.diverse.melange.metamodel/model/Melange.genmodel
Expand Up @@ -60,5 +60,19 @@
<genClasses image="false" ecoreClass="Melange.ecore#//ModelingElement">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Melange.ecore#//ModelingElement/ecoreUri"/>
</genClasses>
<genClasses ecoreClass="Melange.ecore#//Mapping">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EAttribute Melange.ecore#//Mapping/from"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EAttribute Melange.ecore#//Mapping/to"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Melange.ecore#//Mapping/rules"/>
</genClasses>
<genClasses ecoreClass="Melange.ecore#//ClassBinding">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EAttribute Melange.ecore#//ClassBinding/from"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EAttribute Melange.ecore#//ClassBinding/to"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Melange.ecore#//ClassBinding/properties"/>
</genClasses>
<genClasses ecoreClass="Melange.ecore#//PropertyBinding">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Melange.ecore#//PropertyBinding/from"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Melange.ecore#//PropertyBinding/to"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
@@ -0,0 +1,95 @@
/**
*/
package fr.inria.diverse.melange.metamodel.melange;

import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;

/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Class Binding</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link fr.inria.diverse.melange.metamodel.melange.ClassBinding#getFrom <em>From</em>}</li>
* <li>{@link fr.inria.diverse.melange.metamodel.melange.ClassBinding#getTo <em>To</em>}</li>
* <li>{@link fr.inria.diverse.melange.metamodel.melange.ClassBinding#getProperties <em>Properties</em>}</li>
* </ul>
* </p>
*
* @see fr.inria.diverse.melange.metamodel.melange.MelangePackage#getClassBinding()
* @model
* @generated
*/
public interface ClassBinding extends EObject {
/**
* Returns the value of the '<em><b>From</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>From</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>From</em>' attribute.
* @see #setFrom(String)
* @see fr.inria.diverse.melange.metamodel.melange.MelangePackage#getClassBinding_From()
* @model
* @generated
*/
String getFrom();

/**
* Sets the value of the '{@link fr.inria.diverse.melange.metamodel.melange.ClassBinding#getFrom <em>From</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>From</em>' attribute.
* @see #getFrom()
* @generated
*/
void setFrom(String value);

/**
* Returns the value of the '<em><b>To</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>To</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>To</em>' attribute.
* @see #setTo(String)
* @see fr.inria.diverse.melange.metamodel.melange.MelangePackage#getClassBinding_To()
* @model
* @generated
*/
String getTo();

/**
* Sets the value of the '{@link fr.inria.diverse.melange.metamodel.melange.ClassBinding#getTo <em>To</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>To</em>' attribute.
* @see #getTo()
* @generated
*/
void setTo(String value);

/**
* Returns the value of the '<em><b>Properties</b></em>' containment reference list.
* The list contents are of type {@link fr.inria.diverse.melange.metamodel.melange.PropertyBinding}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Properties</em>' containment reference list.
* @see fr.inria.diverse.melange.metamodel.melange.MelangePackage#getClassBinding_Properties()
* @model containment="true"
* @generated
*/
EList<PropertyBinding> getProperties();

} // ClassBinding
@@ -0,0 +1,94 @@
/**
*/
package fr.inria.diverse.melange.metamodel.melange;

import org.eclipse.emf.common.util.EList;

/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Mapping</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link fr.inria.diverse.melange.metamodel.melange.Mapping#getFrom <em>From</em>}</li>
* <li>{@link fr.inria.diverse.melange.metamodel.melange.Mapping#getTo <em>To</em>}</li>
* <li>{@link fr.inria.diverse.melange.metamodel.melange.Mapping#getRules <em>Rules</em>}</li>
* </ul>
* </p>
*
* @see fr.inria.diverse.melange.metamodel.melange.MelangePackage#getMapping()
* @model
* @generated
*/
public interface Mapping extends Element {
/**
* Returns the value of the '<em><b>From</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>From</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>From</em>' attribute.
* @see #setFrom(String)
* @see fr.inria.diverse.melange.metamodel.melange.MelangePackage#getMapping_From()
* @model
* @generated
*/
String getFrom();

/**
* Sets the value of the '{@link fr.inria.diverse.melange.metamodel.melange.Mapping#getFrom <em>From</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>From</em>' attribute.
* @see #getFrom()
* @generated
*/
void setFrom(String value);

/**
* Returns the value of the '<em><b>To</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>To</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>To</em>' attribute.
* @see #setTo(String)
* @see fr.inria.diverse.melange.metamodel.melange.MelangePackage#getMapping_To()
* @model
* @generated
*/
String getTo();

/**
* Sets the value of the '{@link fr.inria.diverse.melange.metamodel.melange.Mapping#getTo <em>To</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>To</em>' attribute.
* @see #getTo()
* @generated
*/
void setTo(String value);

/**
* Returns the value of the '<em><b>Rules</b></em>' containment reference list.
* The list contents are of type {@link fr.inria.diverse.melange.metamodel.melange.ClassBinding}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Rules</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Rules</em>' containment reference list.
* @see fr.inria.diverse.melange.metamodel.melange.MelangePackage#getMapping_Rules()
* @model containment="true"
* @generated
*/
EList<ClassBinding> getRules();

} // Mapping
Expand Up @@ -84,6 +84,33 @@ public interface MelangeFactory extends EFactory {
*/
XbaseTransformation createXbaseTransformation();

/**
* Returns a new object of class '<em>Mapping</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Mapping</em>'.
* @generated
*/
Mapping createMapping();

/**
* Returns a new object of class '<em>Class Binding</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Class Binding</em>'.
* @generated
*/
ClassBinding createClassBinding();

/**
* Returns a new object of class '<em>Property Binding</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Property Binding</em>'.
* @generated
*/
PropertyBinding createPropertyBinding();

/**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
Expand Down

0 comments on commit 3534f44

Please sign in to comment.