Added mapping metamodel and generated code.

This commit is contained in:
Arnaud Dieumegard
2019-01-17 16:03:54 +01:00
parent a3370dc0c7
commit a85ade0b42
60 changed files with 7563 additions and 113 deletions

View File

@@ -0,0 +1,79 @@
/**
*/
package com.irtsaintexupery.pseim.mapping;
import com.irtsaintexupery.pseim.pseim.CardinalityElement;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Cardinality Value</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link com.irtsaintexupery.pseim.mapping.CardinalityValue#getCardinalityElement <em>Cardinality Element</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.CardinalityValue#getValue <em>Value</em>}</li>
* </ul>
*
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getCardinalityValue()
* @model
* @generated
*/
public interface CardinalityValue extends EObject {
/**
* Returns the value of the '<em><b>Cardinality Element</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Cardinality Element</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Cardinality Element</em>' reference.
* @see #setCardinalityElement(CardinalityElement)
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getCardinalityValue_CardinalityElement()
* @model required="true"
* @generated
*/
CardinalityElement getCardinalityElement();
/**
* Sets the value of the '{@link com.irtsaintexupery.pseim.mapping.CardinalityValue#getCardinalityElement <em>Cardinality Element</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Cardinality Element</em>' reference.
* @see #getCardinalityElement()
* @generated
*/
void setCardinalityElement(CardinalityElement value);
/**
* Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Value</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Value</em>' attribute.
* @see #setValue(int)
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getCardinalityValue_Value()
* @model required="true"
* @generated
*/
int getValue();
/**
* Sets the value of the '{@link com.irtsaintexupery.pseim.mapping.CardinalityValue#getValue <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Value</em>' attribute.
* @see #getValue()
* @generated
*/
void setValue(int value);
} // CardinalityValue

View File

@@ -0,0 +1,79 @@
/**
*/
package com.irtsaintexupery.pseim.mapping;
import com.irtsaintexupery.pseim.pseim.CardinalityElement;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Cardinality Value Setting</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link com.irtsaintexupery.pseim.mapping.CardinalityValueSetting#getCardinalityElement <em>Cardinality Element</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.CardinalityValueSetting#getValue <em>Value</em>}</li>
* </ul>
*
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getCardinalityValueSetting()
* @model
* @generated
*/
public interface CardinalityValueSetting extends EObject {
/**
* Returns the value of the '<em><b>Cardinality Element</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Cardinality Element</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Cardinality Element</em>' reference.
* @see #setCardinalityElement(CardinalityElement)
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getCardinalityValueSetting_CardinalityElement()
* @model required="true"
* @generated
*/
CardinalityElement getCardinalityElement();
/**
* Sets the value of the '{@link com.irtsaintexupery.pseim.mapping.CardinalityValueSetting#getCardinalityElement <em>Cardinality Element</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Cardinality Element</em>' reference.
* @see #getCardinalityElement()
* @generated
*/
void setCardinalityElement(CardinalityElement value);
/**
* Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Value</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Value</em>' attribute.
* @see #setValue(int)
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getCardinalityValueSetting_Value()
* @model required="true"
* @generated
*/
int getValue();
/**
* Sets the value of the '{@link com.irtsaintexupery.pseim.mapping.CardinalityValueSetting#getValue <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Value</em>' attribute.
* @see #getValue()
* @generated
*/
void setValue(int value);
} // CardinalityValueSetting

View File

@@ -0,0 +1,70 @@
/**
*/
package com.irtsaintexupery.pseim.mapping;
import com.irtsaintexupery.pseim.seim.GraphElement;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Graph Element Mapping</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link com.irtsaintexupery.pseim.mapping.GraphElementMapping#getModelGraphElement <em>Model Graph Element</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.GraphElementMapping#getPatternGraphElement <em>Pattern Graph Element</em>}</li>
* </ul>
*
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getGraphElementMapping()
* @model
* @generated
*/
public interface GraphElementMapping extends EObject {
/**
* Returns the value of the '<em><b>Model Graph Element</b></em>' reference list.
* The list contents are of type {@link com.irtsaintexupery.pseim.seim.GraphElement}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Model Graph Element</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Model Graph Element</em>' reference list.
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getGraphElementMapping_ModelGraphElement()
* @model ordered="false"
* @generated
*/
EList<GraphElement> getModelGraphElement();
/**
* Returns the value of the '<em><b>Pattern Graph Element</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Pattern Graph Element</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Pattern Graph Element</em>' reference.
* @see #setPatternGraphElement(GraphElement)
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getGraphElementMapping_PatternGraphElement()
* @model required="true"
* @generated
*/
GraphElement getPatternGraphElement();
/**
* Sets the value of the '{@link com.irtsaintexupery.pseim.mapping.GraphElementMapping#getPatternGraphElement <em>Pattern Graph Element</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Pattern Graph Element</em>' reference.
* @see #getPatternGraphElement()
* @generated
*/
void setPatternGraphElement(GraphElement value);
} // GraphElementMapping

View File

@@ -0,0 +1,69 @@
/**
*/
package com.irtsaintexupery.pseim.mapping;
import org.eclipse.emf.ecore.EFactory;
/**
* <!-- begin-user-doc -->
* The <b>Factory</b> for the model.
* It provides a create method for each non-abstract class of the model.
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.MappingPackage
* @generated
*/
public interface MappingFactory extends EFactory {
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
MappingFactory eINSTANCE = com.irtsaintexupery.pseim.mapping.impl.MappingFactoryImpl.init();
/**
* Returns a new object of class '<em>Pattern Application</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Pattern Application</em>'.
* @generated
*/
PatternApplication createPatternApplication();
/**
* Returns a new object of class '<em>Cardinality Value</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Cardinality Value</em>'.
* @generated
*/
CardinalityValue createCardinalityValue();
/**
* Returns a new object of class '<em>Port Mapping</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Port Mapping</em>'.
* @generated
*/
PortMapping createPortMapping();
/**
* Returns a new object of class '<em>Graph Element Mapping</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Graph Element Mapping</em>'.
* @generated
*/
GraphElementMapping createGraphElementMapping();
/**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the package supported by this factory.
* @generated
*/
MappingPackage getMappingPackage();
} //MappingFactory

View File

@@ -0,0 +1,587 @@
/**
*/
package com.irtsaintexupery.pseim.mapping;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
/**
* <!-- begin-user-doc -->
* The <b>Package</b> for the model.
* It contains accessors for the meta objects to represent
* <ul>
* <li>each class,</li>
* <li>each feature of each class,</li>
* <li>each operation of each class,</li>
* <li>each enum,</li>
* <li>and each data type</li>
* </ul>
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.MappingFactory
* @model kind="package"
* annotation="http://www.eclipse.org/OCL/Import ecore='http://www.eclipse.org/emf/2002/Ecore' pseim='pseim.ecore#/' seim='seim.ecore#/'"
* annotation="http://www.eclipse.org/emf/2002/Ecore invocationDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot' settingDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot' validationDelegates='http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot'"
* @generated
*/
public interface MappingPackage extends EPackage {
/**
* The package name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNAME = "mapping";
/**
* The package namespace URI.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNS_URI = "http://www.irit.fr/patterns/mapping/0.1";
/**
* The package namespace name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNS_PREFIX = "mapping";
/**
* The singleton instance of the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
MappingPackage eINSTANCE = com.irtsaintexupery.pseim.mapping.impl.MappingPackageImpl.init();
/**
* The meta object id for the '{@link com.irtsaintexupery.pseim.mapping.impl.PatternApplicationImpl <em>Pattern Application</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.impl.PatternApplicationImpl
* @see com.irtsaintexupery.pseim.mapping.impl.MappingPackageImpl#getPatternApplication()
* @generated
*/
int PATTERN_APPLICATION = 0;
/**
* The feature id for the '<em><b>Cardinality Values</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PATTERN_APPLICATION__CARDINALITY_VALUES = 0;
/**
* The feature id for the '<em><b>Port Mapping</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PATTERN_APPLICATION__PORT_MAPPING = 1;
/**
* The feature id for the '<em><b>Pattern</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PATTERN_APPLICATION__PATTERN = 2;
/**
* The feature id for the '<em><b>Model Element</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PATTERN_APPLICATION__MODEL_ELEMENT = 3;
/**
* The feature id for the '<em><b>Model</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PATTERN_APPLICATION__MODEL = 4;
/**
* The number of structural features of the '<em>Pattern Application</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PATTERN_APPLICATION_FEATURE_COUNT = 5;
/**
* The number of operations of the '<em>Pattern Application</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PATTERN_APPLICATION_OPERATION_COUNT = 0;
/**
* The meta object id for the '{@link com.irtsaintexupery.pseim.mapping.impl.CardinalityValueImpl <em>Cardinality Value</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.impl.CardinalityValueImpl
* @see com.irtsaintexupery.pseim.mapping.impl.MappingPackageImpl#getCardinalityValue()
* @generated
*/
int CARDINALITY_VALUE = 1;
/**
* The feature id for the '<em><b>Cardinality Element</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CARDINALITY_VALUE__CARDINALITY_ELEMENT = 0;
/**
* The feature id for the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CARDINALITY_VALUE__VALUE = 1;
/**
* The number of structural features of the '<em>Cardinality Value</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CARDINALITY_VALUE_FEATURE_COUNT = 2;
/**
* The number of operations of the '<em>Cardinality Value</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CARDINALITY_VALUE_OPERATION_COUNT = 0;
/**
* The meta object id for the '{@link com.irtsaintexupery.pseim.mapping.impl.PortMappingImpl <em>Port Mapping</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.impl.PortMappingImpl
* @see com.irtsaintexupery.pseim.mapping.impl.MappingPackageImpl#getPortMapping()
* @generated
*/
int PORT_MAPPING = 2;
/**
* The feature id for the '<em><b>Model Port</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PORT_MAPPING__MODEL_PORT = 0;
/**
* The feature id for the '<em><b>Pattern Port</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PORT_MAPPING__PATTERN_PORT = 1;
/**
* The number of structural features of the '<em>Port Mapping</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PORT_MAPPING_FEATURE_COUNT = 2;
/**
* The number of operations of the '<em>Port Mapping</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PORT_MAPPING_OPERATION_COUNT = 0;
/**
* The meta object id for the '{@link com.irtsaintexupery.pseim.mapping.impl.GraphElementMappingImpl <em>Graph Element Mapping</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.impl.GraphElementMappingImpl
* @see com.irtsaintexupery.pseim.mapping.impl.MappingPackageImpl#getGraphElementMapping()
* @generated
*/
int GRAPH_ELEMENT_MAPPING = 3;
/**
* The feature id for the '<em><b>Model Graph Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int GRAPH_ELEMENT_MAPPING__MODEL_GRAPH_ELEMENT = 0;
/**
* The feature id for the '<em><b>Pattern Graph Element</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int GRAPH_ELEMENT_MAPPING__PATTERN_GRAPH_ELEMENT = 1;
/**
* The number of structural features of the '<em>Graph Element Mapping</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int GRAPH_ELEMENT_MAPPING_FEATURE_COUNT = 2;
/**
* The number of operations of the '<em>Graph Element Mapping</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int GRAPH_ELEMENT_MAPPING_OPERATION_COUNT = 0;
/**
* Returns the meta object for class '{@link com.irtsaintexupery.pseim.mapping.PatternApplication <em>Pattern Application</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Pattern Application</em>'.
* @see com.irtsaintexupery.pseim.mapping.PatternApplication
* @generated
*/
EClass getPatternApplication();
/**
* Returns the meta object for the containment reference list '{@link com.irtsaintexupery.pseim.mapping.PatternApplication#getCardinalityValues <em>Cardinality Values</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Cardinality Values</em>'.
* @see com.irtsaintexupery.pseim.mapping.PatternApplication#getCardinalityValues()
* @see #getPatternApplication()
* @generated
*/
EReference getPatternApplication_CardinalityValues();
/**
* Returns the meta object for the containment reference list '{@link com.irtsaintexupery.pseim.mapping.PatternApplication#getPortMapping <em>Port Mapping</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Port Mapping</em>'.
* @see com.irtsaintexupery.pseim.mapping.PatternApplication#getPortMapping()
* @see #getPatternApplication()
* @generated
*/
EReference getPatternApplication_PortMapping();
/**
* Returns the meta object for the reference '{@link com.irtsaintexupery.pseim.mapping.PatternApplication#getPattern <em>Pattern</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Pattern</em>'.
* @see com.irtsaintexupery.pseim.mapping.PatternApplication#getPattern()
* @see #getPatternApplication()
* @generated
*/
EReference getPatternApplication_Pattern();
/**
* Returns the meta object for the containment reference list '{@link com.irtsaintexupery.pseim.mapping.PatternApplication#getModelElement <em>Model Element</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Model Element</em>'.
* @see com.irtsaintexupery.pseim.mapping.PatternApplication#getModelElement()
* @see #getPatternApplication()
* @generated
*/
EReference getPatternApplication_ModelElement();
/**
* Returns the meta object for the reference '{@link com.irtsaintexupery.pseim.mapping.PatternApplication#getModel <em>Model</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Model</em>'.
* @see com.irtsaintexupery.pseim.mapping.PatternApplication#getModel()
* @see #getPatternApplication()
* @generated
*/
EReference getPatternApplication_Model();
/**
* Returns the meta object for class '{@link com.irtsaintexupery.pseim.mapping.CardinalityValue <em>Cardinality Value</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Cardinality Value</em>'.
* @see com.irtsaintexupery.pseim.mapping.CardinalityValue
* @generated
*/
EClass getCardinalityValue();
/**
* Returns the meta object for the reference '{@link com.irtsaintexupery.pseim.mapping.CardinalityValue#getCardinalityElement <em>Cardinality Element</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Cardinality Element</em>'.
* @see com.irtsaintexupery.pseim.mapping.CardinalityValue#getCardinalityElement()
* @see #getCardinalityValue()
* @generated
*/
EReference getCardinalityValue_CardinalityElement();
/**
* Returns the meta object for the attribute '{@link com.irtsaintexupery.pseim.mapping.CardinalityValue#getValue <em>Value</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Value</em>'.
* @see com.irtsaintexupery.pseim.mapping.CardinalityValue#getValue()
* @see #getCardinalityValue()
* @generated
*/
EAttribute getCardinalityValue_Value();
/**
* Returns the meta object for class '{@link com.irtsaintexupery.pseim.mapping.PortMapping <em>Port Mapping</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Port Mapping</em>'.
* @see com.irtsaintexupery.pseim.mapping.PortMapping
* @generated
*/
EClass getPortMapping();
/**
* Returns the meta object for the reference list '{@link com.irtsaintexupery.pseim.mapping.PortMapping#getModelPort <em>Model Port</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Model Port</em>'.
* @see com.irtsaintexupery.pseim.mapping.PortMapping#getModelPort()
* @see #getPortMapping()
* @generated
*/
EReference getPortMapping_ModelPort();
/**
* Returns the meta object for the reference '{@link com.irtsaintexupery.pseim.mapping.PortMapping#getPatternPort <em>Pattern Port</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Pattern Port</em>'.
* @see com.irtsaintexupery.pseim.mapping.PortMapping#getPatternPort()
* @see #getPortMapping()
* @generated
*/
EReference getPortMapping_PatternPort();
/**
* Returns the meta object for class '{@link com.irtsaintexupery.pseim.mapping.GraphElementMapping <em>Graph Element Mapping</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Graph Element Mapping</em>'.
* @see com.irtsaintexupery.pseim.mapping.GraphElementMapping
* @generated
*/
EClass getGraphElementMapping();
/**
* Returns the meta object for the reference list '{@link com.irtsaintexupery.pseim.mapping.GraphElementMapping#getModelGraphElement <em>Model Graph Element</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Model Graph Element</em>'.
* @see com.irtsaintexupery.pseim.mapping.GraphElementMapping#getModelGraphElement()
* @see #getGraphElementMapping()
* @generated
*/
EReference getGraphElementMapping_ModelGraphElement();
/**
* Returns the meta object for the reference '{@link com.irtsaintexupery.pseim.mapping.GraphElementMapping#getPatternGraphElement <em>Pattern Graph Element</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Pattern Graph Element</em>'.
* @see com.irtsaintexupery.pseim.mapping.GraphElementMapping#getPatternGraphElement()
* @see #getGraphElementMapping()
* @generated
*/
EReference getGraphElementMapping_PatternGraphElement();
/**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the factory that creates the instances of the model.
* @generated
*/
MappingFactory getMappingFactory();
/**
* <!-- begin-user-doc -->
* Defines literals for the meta objects that represent
* <ul>
* <li>each class,</li>
* <li>each feature of each class,</li>
* <li>each operation of each class,</li>
* <li>each enum,</li>
* <li>and each data type</li>
* </ul>
* <!-- end-user-doc -->
* @generated
*/
interface Literals {
/**
* The meta object literal for the '{@link com.irtsaintexupery.pseim.mapping.impl.PatternApplicationImpl <em>Pattern Application</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.impl.PatternApplicationImpl
* @see com.irtsaintexupery.pseim.mapping.impl.MappingPackageImpl#getPatternApplication()
* @generated
*/
EClass PATTERN_APPLICATION = eINSTANCE.getPatternApplication();
/**
* The meta object literal for the '<em><b>Cardinality Values</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference PATTERN_APPLICATION__CARDINALITY_VALUES = eINSTANCE.getPatternApplication_CardinalityValues();
/**
* The meta object literal for the '<em><b>Port Mapping</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference PATTERN_APPLICATION__PORT_MAPPING = eINSTANCE.getPatternApplication_PortMapping();
/**
* The meta object literal for the '<em><b>Pattern</b></em>' reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference PATTERN_APPLICATION__PATTERN = eINSTANCE.getPatternApplication_Pattern();
/**
* The meta object literal for the '<em><b>Model Element</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference PATTERN_APPLICATION__MODEL_ELEMENT = eINSTANCE.getPatternApplication_ModelElement();
/**
* The meta object literal for the '<em><b>Model</b></em>' reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference PATTERN_APPLICATION__MODEL = eINSTANCE.getPatternApplication_Model();
/**
* The meta object literal for the '{@link com.irtsaintexupery.pseim.mapping.impl.CardinalityValueImpl <em>Cardinality Value</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.impl.CardinalityValueImpl
* @see com.irtsaintexupery.pseim.mapping.impl.MappingPackageImpl#getCardinalityValue()
* @generated
*/
EClass CARDINALITY_VALUE = eINSTANCE.getCardinalityValue();
/**
* The meta object literal for the '<em><b>Cardinality Element</b></em>' reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference CARDINALITY_VALUE__CARDINALITY_ELEMENT = eINSTANCE.getCardinalityValue_CardinalityElement();
/**
* The meta object literal for the '<em><b>Value</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute CARDINALITY_VALUE__VALUE = eINSTANCE.getCardinalityValue_Value();
/**
* The meta object literal for the '{@link com.irtsaintexupery.pseim.mapping.impl.PortMappingImpl <em>Port Mapping</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.impl.PortMappingImpl
* @see com.irtsaintexupery.pseim.mapping.impl.MappingPackageImpl#getPortMapping()
* @generated
*/
EClass PORT_MAPPING = eINSTANCE.getPortMapping();
/**
* The meta object literal for the '<em><b>Model Port</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference PORT_MAPPING__MODEL_PORT = eINSTANCE.getPortMapping_ModelPort();
/**
* The meta object literal for the '<em><b>Pattern Port</b></em>' reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference PORT_MAPPING__PATTERN_PORT = eINSTANCE.getPortMapping_PatternPort();
/**
* The meta object literal for the '{@link com.irtsaintexupery.pseim.mapping.impl.GraphElementMappingImpl <em>Graph Element Mapping</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.impl.GraphElementMappingImpl
* @see com.irtsaintexupery.pseim.mapping.impl.MappingPackageImpl#getGraphElementMapping()
* @generated
*/
EClass GRAPH_ELEMENT_MAPPING = eINSTANCE.getGraphElementMapping();
/**
* The meta object literal for the '<em><b>Model Graph Element</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference GRAPH_ELEMENT_MAPPING__MODEL_GRAPH_ELEMENT = eINSTANCE.getGraphElementMapping_ModelGraphElement();
/**
* The meta object literal for the '<em><b>Pattern Graph Element</b></em>' reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference GRAPH_ELEMENT_MAPPING__PATTERN_GRAPH_ELEMENT = eINSTANCE.getGraphElementMapping_PatternGraphElement();
}
} //MappingPackage

View File

@@ -0,0 +1,135 @@
/**
*/
package com.irtsaintexupery.pseim.mapping;
import com.irtsaintexupery.pseim.pseim.Pattern;
import com.irtsaintexupery.pseim.seim.Model;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Pattern Application</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link com.irtsaintexupery.pseim.mapping.PatternApplication#getCardinalityValues <em>Cardinality Values</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.PatternApplication#getPortMapping <em>Port Mapping</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.PatternApplication#getPattern <em>Pattern</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.PatternApplication#getModelElement <em>Model Element</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.PatternApplication#getModel <em>Model</em>}</li>
* </ul>
*
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getPatternApplication()
* @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='InvariantName'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot InvariantName='true'"
* @generated
*/
public interface PatternApplication extends EObject {
/**
* Returns the value of the '<em><b>Cardinality Values</b></em>' containment reference list.
* The list contents are of type {@link com.irtsaintexupery.pseim.mapping.CardinalityValue}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Cardinality Values</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>Cardinality Values</em>' containment reference list.
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getPatternApplication_CardinalityValues()
* @model containment="true"
* @generated
*/
EList<CardinalityValue> getCardinalityValues();
/**
* Returns the value of the '<em><b>Port Mapping</b></em>' containment reference list.
* The list contents are of type {@link com.irtsaintexupery.pseim.mapping.PortMapping}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Port Mapping</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>Port Mapping</em>' containment reference list.
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getPatternApplication_PortMapping()
* @model containment="true"
* @generated
*/
EList<PortMapping> getPortMapping();
/**
* Returns the value of the '<em><b>Pattern</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Pattern</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Pattern</em>' reference.
* @see #setPattern(Pattern)
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getPatternApplication_Pattern()
* @model required="true"
* @generated
*/
Pattern getPattern();
/**
* Sets the value of the '{@link com.irtsaintexupery.pseim.mapping.PatternApplication#getPattern <em>Pattern</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Pattern</em>' reference.
* @see #getPattern()
* @generated
*/
void setPattern(Pattern value);
/**
* Returns the value of the '<em><b>Model Element</b></em>' containment reference list.
* The list contents are of type {@link com.irtsaintexupery.pseim.mapping.GraphElementMapping}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Model Element</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>Model Element</em>' containment reference list.
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getPatternApplication_ModelElement()
* @model containment="true" required="true"
* @generated
*/
EList<GraphElementMapping> getModelElement();
/**
* Returns the value of the '<em><b>Model</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Model</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Model</em>' reference.
* @see #setModel(Model)
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getPatternApplication_Model()
* @model required="true"
* @generated
*/
Model getModel();
/**
* Sets the value of the '{@link com.irtsaintexupery.pseim.mapping.PatternApplication#getModel <em>Model</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Model</em>' reference.
* @see #getModel()
* @generated
*/
void setModel(Model value);
} // PatternApplication

View File

@@ -0,0 +1,70 @@
/**
*/
package com.irtsaintexupery.pseim.mapping;
import com.irtsaintexupery.pseim.seim.BorderElement;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Port Mapping</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link com.irtsaintexupery.pseim.mapping.PortMapping#getModelPort <em>Model Port</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.PortMapping#getPatternPort <em>Pattern Port</em>}</li>
* </ul>
*
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getPortMapping()
* @model
* @generated
*/
public interface PortMapping extends EObject {
/**
* Returns the value of the '<em><b>Model Port</b></em>' reference list.
* The list contents are of type {@link com.irtsaintexupery.pseim.seim.BorderElement}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Model Port</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Model Port</em>' reference list.
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getPortMapping_ModelPort()
* @model ordered="false"
* @generated
*/
EList<BorderElement> getModelPort();
/**
* Returns the value of the '<em><b>Pattern Port</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Pattern Port</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Pattern Port</em>' reference.
* @see #setPatternPort(BorderElement)
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#getPortMapping_PatternPort()
* @model required="true"
* @generated
*/
BorderElement getPatternPort();
/**
* Sets the value of the '{@link com.irtsaintexupery.pseim.mapping.PortMapping#getPatternPort <em>Pattern Port</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Pattern Port</em>' reference.
* @see #getPatternPort()
* @generated
*/
void setPatternPort(BorderElement value);
} // PortMapping

View File

@@ -0,0 +1,226 @@
/**
*/
package com.irtsaintexupery.pseim.mapping.impl;
import com.irtsaintexupery.pseim.mapping.CardinalityValue;
import com.irtsaintexupery.pseim.mapping.MappingPackage;
import com.irtsaintexupery.pseim.pseim.CardinalityElement;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Cardinality Value</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link com.irtsaintexupery.pseim.mapping.impl.CardinalityValueImpl#getCardinalityElement <em>Cardinality Element</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.impl.CardinalityValueImpl#getValue <em>Value</em>}</li>
* </ul>
*
* @generated
*/
public class CardinalityValueImpl extends MinimalEObjectImpl.Container implements CardinalityValue {
/**
* The cached value of the '{@link #getCardinalityElement() <em>Cardinality Element</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCardinalityElement()
* @generated
* @ordered
*/
protected CardinalityElement cardinalityElement;
/**
* The default value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected static final int VALUE_EDEFAULT = 0;
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected int value = VALUE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CardinalityValueImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return MappingPackage.Literals.CARDINALITY_VALUE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CardinalityElement getCardinalityElement() {
if (cardinalityElement != null && cardinalityElement.eIsProxy()) {
InternalEObject oldCardinalityElement = (InternalEObject)cardinalityElement;
cardinalityElement = (CardinalityElement)eResolveProxy(oldCardinalityElement);
if (cardinalityElement != oldCardinalityElement) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, MappingPackage.CARDINALITY_VALUE__CARDINALITY_ELEMENT, oldCardinalityElement, cardinalityElement));
}
}
return cardinalityElement;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CardinalityElement basicGetCardinalityElement() {
return cardinalityElement;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCardinalityElement(CardinalityElement newCardinalityElement) {
CardinalityElement oldCardinalityElement = cardinalityElement;
cardinalityElement = newCardinalityElement;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MappingPackage.CARDINALITY_VALUE__CARDINALITY_ELEMENT, oldCardinalityElement, cardinalityElement));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValue(int newValue) {
int oldValue = value;
value = newValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MappingPackage.CARDINALITY_VALUE__VALUE, oldValue, value));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case MappingPackage.CARDINALITY_VALUE__CARDINALITY_ELEMENT:
if (resolve) return getCardinalityElement();
return basicGetCardinalityElement();
case MappingPackage.CARDINALITY_VALUE__VALUE:
return getValue();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case MappingPackage.CARDINALITY_VALUE__CARDINALITY_ELEMENT:
setCardinalityElement((CardinalityElement)newValue);
return;
case MappingPackage.CARDINALITY_VALUE__VALUE:
setValue((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case MappingPackage.CARDINALITY_VALUE__CARDINALITY_ELEMENT:
setCardinalityElement((CardinalityElement)null);
return;
case MappingPackage.CARDINALITY_VALUE__VALUE:
setValue(VALUE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case MappingPackage.CARDINALITY_VALUE__CARDINALITY_ELEMENT:
return cardinalityElement != null;
case MappingPackage.CARDINALITY_VALUE__VALUE:
return value != VALUE_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (value: ");
result.append(value);
result.append(')');
return result.toString();
}
} //CardinalityValueImpl

View File

@@ -0,0 +1,196 @@
/**
*/
package com.irtsaintexupery.pseim.mapping.impl;
import com.irtsaintexupery.pseim.mapping.GraphElementMapping;
import com.irtsaintexupery.pseim.mapping.MappingPackage;
import com.irtsaintexupery.pseim.seim.GraphElement;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Graph Element Mapping</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link com.irtsaintexupery.pseim.mapping.impl.GraphElementMappingImpl#getModelGraphElement <em>Model Graph Element</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.impl.GraphElementMappingImpl#getPatternGraphElement <em>Pattern Graph Element</em>}</li>
* </ul>
*
* @generated
*/
public class GraphElementMappingImpl extends MinimalEObjectImpl.Container implements GraphElementMapping {
/**
* The cached value of the '{@link #getModelGraphElement() <em>Model Graph Element</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getModelGraphElement()
* @generated
* @ordered
*/
protected EList<GraphElement> modelGraphElement;
/**
* The cached value of the '{@link #getPatternGraphElement() <em>Pattern Graph Element</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPatternGraphElement()
* @generated
* @ordered
*/
protected GraphElement patternGraphElement;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected GraphElementMappingImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return MappingPackage.Literals.GRAPH_ELEMENT_MAPPING;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<GraphElement> getModelGraphElement() {
if (modelGraphElement == null) {
modelGraphElement = new EObjectResolvingEList<GraphElement>(GraphElement.class, this, MappingPackage.GRAPH_ELEMENT_MAPPING__MODEL_GRAPH_ELEMENT);
}
return modelGraphElement;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public GraphElement getPatternGraphElement() {
if (patternGraphElement != null && patternGraphElement.eIsProxy()) {
InternalEObject oldPatternGraphElement = (InternalEObject)patternGraphElement;
patternGraphElement = (GraphElement)eResolveProxy(oldPatternGraphElement);
if (patternGraphElement != oldPatternGraphElement) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, MappingPackage.GRAPH_ELEMENT_MAPPING__PATTERN_GRAPH_ELEMENT, oldPatternGraphElement, patternGraphElement));
}
}
return patternGraphElement;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public GraphElement basicGetPatternGraphElement() {
return patternGraphElement;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPatternGraphElement(GraphElement newPatternGraphElement) {
GraphElement oldPatternGraphElement = patternGraphElement;
patternGraphElement = newPatternGraphElement;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MappingPackage.GRAPH_ELEMENT_MAPPING__PATTERN_GRAPH_ELEMENT, oldPatternGraphElement, patternGraphElement));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case MappingPackage.GRAPH_ELEMENT_MAPPING__MODEL_GRAPH_ELEMENT:
return getModelGraphElement();
case MappingPackage.GRAPH_ELEMENT_MAPPING__PATTERN_GRAPH_ELEMENT:
if (resolve) return getPatternGraphElement();
return basicGetPatternGraphElement();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case MappingPackage.GRAPH_ELEMENT_MAPPING__MODEL_GRAPH_ELEMENT:
getModelGraphElement().clear();
getModelGraphElement().addAll((Collection<? extends GraphElement>)newValue);
return;
case MappingPackage.GRAPH_ELEMENT_MAPPING__PATTERN_GRAPH_ELEMENT:
setPatternGraphElement((GraphElement)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case MappingPackage.GRAPH_ELEMENT_MAPPING__MODEL_GRAPH_ELEMENT:
getModelGraphElement().clear();
return;
case MappingPackage.GRAPH_ELEMENT_MAPPING__PATTERN_GRAPH_ELEMENT:
setPatternGraphElement((GraphElement)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case MappingPackage.GRAPH_ELEMENT_MAPPING__MODEL_GRAPH_ELEMENT:
return modelGraphElement != null && !modelGraphElement.isEmpty();
case MappingPackage.GRAPH_ELEMENT_MAPPING__PATTERN_GRAPH_ELEMENT:
return patternGraphElement != null;
}
return super.eIsSet(featureID);
}
} //GraphElementMappingImpl

View File

@@ -0,0 +1,128 @@
/**
*/
package com.irtsaintexupery.pseim.mapping.impl;
import com.irtsaintexupery.pseim.mapping.*;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
* @generated
*/
public class MappingFactoryImpl extends EFactoryImpl implements MappingFactory {
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static MappingFactory init() {
try {
MappingFactory theMappingFactory = (MappingFactory)EPackage.Registry.INSTANCE.getEFactory(MappingPackage.eNS_URI);
if (theMappingFactory != null) {
return theMappingFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new MappingFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MappingFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case MappingPackage.PATTERN_APPLICATION: return createPatternApplication();
case MappingPackage.CARDINALITY_VALUE: return createCardinalityValue();
case MappingPackage.PORT_MAPPING: return createPortMapping();
case MappingPackage.GRAPH_ELEMENT_MAPPING: return createGraphElementMapping();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PatternApplication createPatternApplication() {
PatternApplicationImpl patternApplication = new PatternApplicationImpl();
return patternApplication;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CardinalityValue createCardinalityValue() {
CardinalityValueImpl cardinalityValue = new CardinalityValueImpl();
return cardinalityValue;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PortMapping createPortMapping() {
PortMappingImpl portMapping = new PortMappingImpl();
return portMapping;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public GraphElementMapping createGraphElementMapping() {
GraphElementMappingImpl graphElementMapping = new GraphElementMappingImpl();
return graphElementMapping;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MappingPackage getMappingPackage() {
return (MappingPackage)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static MappingPackage getPackage() {
return MappingPackage.eINSTANCE;
}
} //MappingFactoryImpl

View File

@@ -0,0 +1,440 @@
/**
*/
package com.irtsaintexupery.pseim.mapping.impl;
import com.irtsaintexupery.pseim.mapping.CardinalityValue;
import com.irtsaintexupery.pseim.mapping.GraphElementMapping;
import com.irtsaintexupery.pseim.mapping.MappingFactory;
import com.irtsaintexupery.pseim.mapping.MappingPackage;
import com.irtsaintexupery.pseim.mapping.PatternApplication;
import com.irtsaintexupery.pseim.mapping.PortMapping;
import com.irtsaintexupery.pseim.mapping.util.MappingValidator;
import com.irtsaintexupery.pseim.pseim.PseimPackage;
import com.irtsaintexupery.pseim.seim.SeimPackage;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EValidator;
import org.eclipse.emf.ecore.impl.EPackageImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class MappingPackageImpl extends EPackageImpl implements MappingPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass patternApplicationEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass cardinalityValueEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass portMappingEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass graphElementMappingEClass = null;
/**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
* <p>Note: the correct way to create the package is via the static
* factory method {@link #init init()}, which also performs
* initialization of the package, or returns the registered package,
* if one already exists.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.emf.ecore.EPackage.Registry
* @see com.irtsaintexupery.pseim.mapping.MappingPackage#eNS_URI
* @see #init()
* @generated
*/
private MappingPackageImpl() {
super(eNS_URI, MappingFactory.eINSTANCE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static boolean isInited = false;
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>This method is used to initialize {@link MappingPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static MappingPackage init() {
if (isInited) return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI);
// Obtain or create and register package
MappingPackageImpl theMappingPackage = (MappingPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof MappingPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new MappingPackageImpl());
isInited = true;
// Initialize simple dependencies
PseimPackage.eINSTANCE.eClass();
SeimPackage.eINSTANCE.eClass();
// Create package meta-data objects
theMappingPackage.createPackageContents();
// Initialize created meta-data
theMappingPackage.initializePackageContents();
// Register package validator
EValidator.Registry.INSTANCE.put
(theMappingPackage,
new EValidator.Descriptor() {
public EValidator getEValidator() {
return MappingValidator.INSTANCE;
}
});
// Mark meta-data to indicate it can't be changed
theMappingPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(MappingPackage.eNS_URI, theMappingPackage);
return theMappingPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getPatternApplication() {
return patternApplicationEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getPatternApplication_CardinalityValues() {
return (EReference)patternApplicationEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getPatternApplication_PortMapping() {
return (EReference)patternApplicationEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getPatternApplication_Pattern() {
return (EReference)patternApplicationEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getPatternApplication_ModelElement() {
return (EReference)patternApplicationEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getPatternApplication_Model() {
return (EReference)patternApplicationEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getCardinalityValue() {
return cardinalityValueEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getCardinalityValue_CardinalityElement() {
return (EReference)cardinalityValueEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getCardinalityValue_Value() {
return (EAttribute)cardinalityValueEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getPortMapping() {
return portMappingEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getPortMapping_ModelPort() {
return (EReference)portMappingEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getPortMapping_PatternPort() {
return (EReference)portMappingEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getGraphElementMapping() {
return graphElementMappingEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getGraphElementMapping_ModelGraphElement() {
return (EReference)graphElementMappingEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getGraphElementMapping_PatternGraphElement() {
return (EReference)graphElementMappingEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MappingFactory getMappingFactory() {
return (MappingFactory)getEFactoryInstance();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isCreated = false;
/**
* Creates the meta-model objects for the package. This method is
* guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void createPackageContents() {
if (isCreated) return;
isCreated = true;
// Create classes and their features
patternApplicationEClass = createEClass(PATTERN_APPLICATION);
createEReference(patternApplicationEClass, PATTERN_APPLICATION__CARDINALITY_VALUES);
createEReference(patternApplicationEClass, PATTERN_APPLICATION__PORT_MAPPING);
createEReference(patternApplicationEClass, PATTERN_APPLICATION__PATTERN);
createEReference(patternApplicationEClass, PATTERN_APPLICATION__MODEL_ELEMENT);
createEReference(patternApplicationEClass, PATTERN_APPLICATION__MODEL);
cardinalityValueEClass = createEClass(CARDINALITY_VALUE);
createEReference(cardinalityValueEClass, CARDINALITY_VALUE__CARDINALITY_ELEMENT);
createEAttribute(cardinalityValueEClass, CARDINALITY_VALUE__VALUE);
portMappingEClass = createEClass(PORT_MAPPING);
createEReference(portMappingEClass, PORT_MAPPING__MODEL_PORT);
createEReference(portMappingEClass, PORT_MAPPING__PATTERN_PORT);
graphElementMappingEClass = createEClass(GRAPH_ELEMENT_MAPPING);
createEReference(graphElementMappingEClass, GRAPH_ELEMENT_MAPPING__MODEL_GRAPH_ELEMENT);
createEReference(graphElementMappingEClass, GRAPH_ELEMENT_MAPPING__PATTERN_GRAPH_ELEMENT);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isInitialized = false;
/**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void initializePackageContents() {
if (isInitialized) return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Obtain other dependent packages
PseimPackage thePseimPackage = (PseimPackage)EPackage.Registry.INSTANCE.getEPackage(PseimPackage.eNS_URI);
SeimPackage theSeimPackage = (SeimPackage)EPackage.Registry.INSTANCE.getEPackage(SeimPackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
// Initialize classes, features, and operations; add parameters
initEClass(patternApplicationEClass, PatternApplication.class, "PatternApplication", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getPatternApplication_CardinalityValues(), this.getCardinalityValue(), null, "cardinalityValues", null, 0, -1, PatternApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getPatternApplication_PortMapping(), this.getPortMapping(), null, "portMapping", null, 0, -1, PatternApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getPatternApplication_Pattern(), thePseimPackage.getPattern(), null, "pattern", null, 1, 1, PatternApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getPatternApplication_ModelElement(), this.getGraphElementMapping(), null, "modelElement", null, 1, -1, PatternApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getPatternApplication_Model(), theSeimPackage.getModel(), null, "model", null, 1, 1, PatternApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(cardinalityValueEClass, CardinalityValue.class, "CardinalityValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getCardinalityValue_CardinalityElement(), thePseimPackage.getCardinalityElement(), null, "cardinalityElement", null, 1, 1, CardinalityValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getCardinalityValue_Value(), ecorePackage.getEInt(), "value", null, 1, 1, CardinalityValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(portMappingEClass, PortMapping.class, "PortMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getPortMapping_ModelPort(), theSeimPackage.getBorderElement(), null, "modelPort", null, 0, -1, PortMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
initEReference(getPortMapping_PatternPort(), theSeimPackage.getBorderElement(), null, "patternPort", null, 1, 1, PortMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(graphElementMappingEClass, GraphElementMapping.class, "GraphElementMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getGraphElementMapping_ModelGraphElement(), theSeimPackage.getGraphElement(), null, "modelGraphElement", null, 0, -1, GraphElementMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
initEReference(getGraphElementMapping_PatternGraphElement(), theSeimPackage.getGraphElement(), null, "patternGraphElement", null, 1, 1, GraphElementMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource(eNS_URI);
// Create annotations
// http://www.eclipse.org/OCL/Import
createImportAnnotations();
// http://www.eclipse.org/emf/2002/Ecore
createEcoreAnnotations();
// http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot
createPivotAnnotations();
}
/**
* Initializes the annotations for <b>http://www.eclipse.org/OCL/Import</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createImportAnnotations() {
String source = "http://www.eclipse.org/OCL/Import";
addAnnotation
(this,
source,
new String[] {
"ecore", "http://www.eclipse.org/emf/2002/Ecore",
"pseim", "pseim.ecore#/",
"seim", "seim.ecore#/"
});
}
/**
* Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createEcoreAnnotations() {
String source = "http://www.eclipse.org/emf/2002/Ecore";
addAnnotation
(this,
source,
new String[] {
"invocationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
"settingDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
"validationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"
});
addAnnotation
(patternApplicationEClass,
source,
new String[] {
"constraints", "InvariantName"
});
}
/**
* Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createPivotAnnotations() {
String source = "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot";
addAnnotation
(patternApplicationEClass,
source,
new String[] {
"InvariantName", "true"
});
}
} //MappingPackageImpl

View File

@@ -0,0 +1,352 @@
/**
*/
package com.irtsaintexupery.pseim.mapping.impl;
import com.irtsaintexupery.pseim.mapping.CardinalityValue;
import com.irtsaintexupery.pseim.mapping.GraphElementMapping;
import com.irtsaintexupery.pseim.mapping.MappingPackage;
import com.irtsaintexupery.pseim.mapping.PatternApplication;
import com.irtsaintexupery.pseim.mapping.PortMapping;
import com.irtsaintexupery.pseim.pseim.Pattern;
import com.irtsaintexupery.pseim.seim.Model;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Pattern Application</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link com.irtsaintexupery.pseim.mapping.impl.PatternApplicationImpl#getCardinalityValues <em>Cardinality Values</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.impl.PatternApplicationImpl#getPortMapping <em>Port Mapping</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.impl.PatternApplicationImpl#getPattern <em>Pattern</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.impl.PatternApplicationImpl#getModelElement <em>Model Element</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.impl.PatternApplicationImpl#getModel <em>Model</em>}</li>
* </ul>
*
* @generated
*/
public class PatternApplicationImpl extends MinimalEObjectImpl.Container implements PatternApplication {
/**
* The cached value of the '{@link #getCardinalityValues() <em>Cardinality Values</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCardinalityValues()
* @generated
* @ordered
*/
protected EList<CardinalityValue> cardinalityValues;
/**
* The cached value of the '{@link #getPortMapping() <em>Port Mapping</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPortMapping()
* @generated
* @ordered
*/
protected EList<PortMapping> portMapping;
/**
* The cached value of the '{@link #getPattern() <em>Pattern</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPattern()
* @generated
* @ordered
*/
protected Pattern pattern;
/**
* The cached value of the '{@link #getModelElement() <em>Model Element</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getModelElement()
* @generated
* @ordered
*/
protected EList<GraphElementMapping> modelElement;
/**
* The cached value of the '{@link #getModel() <em>Model</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getModel()
* @generated
* @ordered
*/
protected Model model;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PatternApplicationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return MappingPackage.Literals.PATTERN_APPLICATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<CardinalityValue> getCardinalityValues() {
if (cardinalityValues == null) {
cardinalityValues = new EObjectContainmentEList<CardinalityValue>(CardinalityValue.class, this, MappingPackage.PATTERN_APPLICATION__CARDINALITY_VALUES);
}
return cardinalityValues;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<PortMapping> getPortMapping() {
if (portMapping == null) {
portMapping = new EObjectContainmentEList<PortMapping>(PortMapping.class, this, MappingPackage.PATTERN_APPLICATION__PORT_MAPPING);
}
return portMapping;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Pattern getPattern() {
if (pattern != null && pattern.eIsProxy()) {
InternalEObject oldPattern = (InternalEObject)pattern;
pattern = (Pattern)eResolveProxy(oldPattern);
if (pattern != oldPattern) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, MappingPackage.PATTERN_APPLICATION__PATTERN, oldPattern, pattern));
}
}
return pattern;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Pattern basicGetPattern() {
return pattern;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPattern(Pattern newPattern) {
Pattern oldPattern = pattern;
pattern = newPattern;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MappingPackage.PATTERN_APPLICATION__PATTERN, oldPattern, pattern));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<GraphElementMapping> getModelElement() {
if (modelElement == null) {
modelElement = new EObjectContainmentEList<GraphElementMapping>(GraphElementMapping.class, this, MappingPackage.PATTERN_APPLICATION__MODEL_ELEMENT);
}
return modelElement;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Model getModel() {
if (model != null && model.eIsProxy()) {
InternalEObject oldModel = (InternalEObject)model;
model = (Model)eResolveProxy(oldModel);
if (model != oldModel) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, MappingPackage.PATTERN_APPLICATION__MODEL, oldModel, model));
}
}
return model;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Model basicGetModel() {
return model;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setModel(Model newModel) {
Model oldModel = model;
model = newModel;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MappingPackage.PATTERN_APPLICATION__MODEL, oldModel, model));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case MappingPackage.PATTERN_APPLICATION__CARDINALITY_VALUES:
return ((InternalEList<?>)getCardinalityValues()).basicRemove(otherEnd, msgs);
case MappingPackage.PATTERN_APPLICATION__PORT_MAPPING:
return ((InternalEList<?>)getPortMapping()).basicRemove(otherEnd, msgs);
case MappingPackage.PATTERN_APPLICATION__MODEL_ELEMENT:
return ((InternalEList<?>)getModelElement()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case MappingPackage.PATTERN_APPLICATION__CARDINALITY_VALUES:
return getCardinalityValues();
case MappingPackage.PATTERN_APPLICATION__PORT_MAPPING:
return getPortMapping();
case MappingPackage.PATTERN_APPLICATION__PATTERN:
if (resolve) return getPattern();
return basicGetPattern();
case MappingPackage.PATTERN_APPLICATION__MODEL_ELEMENT:
return getModelElement();
case MappingPackage.PATTERN_APPLICATION__MODEL:
if (resolve) return getModel();
return basicGetModel();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case MappingPackage.PATTERN_APPLICATION__CARDINALITY_VALUES:
getCardinalityValues().clear();
getCardinalityValues().addAll((Collection<? extends CardinalityValue>)newValue);
return;
case MappingPackage.PATTERN_APPLICATION__PORT_MAPPING:
getPortMapping().clear();
getPortMapping().addAll((Collection<? extends PortMapping>)newValue);
return;
case MappingPackage.PATTERN_APPLICATION__PATTERN:
setPattern((Pattern)newValue);
return;
case MappingPackage.PATTERN_APPLICATION__MODEL_ELEMENT:
getModelElement().clear();
getModelElement().addAll((Collection<? extends GraphElementMapping>)newValue);
return;
case MappingPackage.PATTERN_APPLICATION__MODEL:
setModel((Model)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case MappingPackage.PATTERN_APPLICATION__CARDINALITY_VALUES:
getCardinalityValues().clear();
return;
case MappingPackage.PATTERN_APPLICATION__PORT_MAPPING:
getPortMapping().clear();
return;
case MappingPackage.PATTERN_APPLICATION__PATTERN:
setPattern((Pattern)null);
return;
case MappingPackage.PATTERN_APPLICATION__MODEL_ELEMENT:
getModelElement().clear();
return;
case MappingPackage.PATTERN_APPLICATION__MODEL:
setModel((Model)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case MappingPackage.PATTERN_APPLICATION__CARDINALITY_VALUES:
return cardinalityValues != null && !cardinalityValues.isEmpty();
case MappingPackage.PATTERN_APPLICATION__PORT_MAPPING:
return portMapping != null && !portMapping.isEmpty();
case MappingPackage.PATTERN_APPLICATION__PATTERN:
return pattern != null;
case MappingPackage.PATTERN_APPLICATION__MODEL_ELEMENT:
return modelElement != null && !modelElement.isEmpty();
case MappingPackage.PATTERN_APPLICATION__MODEL:
return model != null;
}
return super.eIsSet(featureID);
}
} //PatternApplicationImpl

View File

@@ -0,0 +1,196 @@
/**
*/
package com.irtsaintexupery.pseim.mapping.impl;
import com.irtsaintexupery.pseim.mapping.MappingPackage;
import com.irtsaintexupery.pseim.mapping.PortMapping;
import com.irtsaintexupery.pseim.seim.BorderElement;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Port Mapping</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link com.irtsaintexupery.pseim.mapping.impl.PortMappingImpl#getModelPort <em>Model Port</em>}</li>
* <li>{@link com.irtsaintexupery.pseim.mapping.impl.PortMappingImpl#getPatternPort <em>Pattern Port</em>}</li>
* </ul>
*
* @generated
*/
public class PortMappingImpl extends MinimalEObjectImpl.Container implements PortMapping {
/**
* The cached value of the '{@link #getModelPort() <em>Model Port</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getModelPort()
* @generated
* @ordered
*/
protected EList<BorderElement> modelPort;
/**
* The cached value of the '{@link #getPatternPort() <em>Pattern Port</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPatternPort()
* @generated
* @ordered
*/
protected BorderElement patternPort;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PortMappingImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return MappingPackage.Literals.PORT_MAPPING;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<BorderElement> getModelPort() {
if (modelPort == null) {
modelPort = new EObjectResolvingEList<BorderElement>(BorderElement.class, this, MappingPackage.PORT_MAPPING__MODEL_PORT);
}
return modelPort;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BorderElement getPatternPort() {
if (patternPort != null && patternPort.eIsProxy()) {
InternalEObject oldPatternPort = (InternalEObject)patternPort;
patternPort = (BorderElement)eResolveProxy(oldPatternPort);
if (patternPort != oldPatternPort) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, MappingPackage.PORT_MAPPING__PATTERN_PORT, oldPatternPort, patternPort));
}
}
return patternPort;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BorderElement basicGetPatternPort() {
return patternPort;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPatternPort(BorderElement newPatternPort) {
BorderElement oldPatternPort = patternPort;
patternPort = newPatternPort;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MappingPackage.PORT_MAPPING__PATTERN_PORT, oldPatternPort, patternPort));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case MappingPackage.PORT_MAPPING__MODEL_PORT:
return getModelPort();
case MappingPackage.PORT_MAPPING__PATTERN_PORT:
if (resolve) return getPatternPort();
return basicGetPatternPort();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case MappingPackage.PORT_MAPPING__MODEL_PORT:
getModelPort().clear();
getModelPort().addAll((Collection<? extends BorderElement>)newValue);
return;
case MappingPackage.PORT_MAPPING__PATTERN_PORT:
setPatternPort((BorderElement)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case MappingPackage.PORT_MAPPING__MODEL_PORT:
getModelPort().clear();
return;
case MappingPackage.PORT_MAPPING__PATTERN_PORT:
setPatternPort((BorderElement)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case MappingPackage.PORT_MAPPING__MODEL_PORT:
return modelPort != null && !modelPort.isEmpty();
case MappingPackage.PORT_MAPPING__PATTERN_PORT:
return patternPort != null;
}
return super.eIsSet(featureID);
}
} //PortMappingImpl

View File

@@ -0,0 +1,174 @@
/**
*/
package com.irtsaintexupery.pseim.mapping.util;
import com.irtsaintexupery.pseim.mapping.*;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* The <b>Adapter Factory</b> for the model.
* It provides an adapter <code>createXXX</code> method for each class of the model.
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.MappingPackage
* @generated
*/
public class MappingAdapterFactory extends AdapterFactoryImpl {
/**
* The cached model package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static MappingPackage modelPackage;
/**
* Creates an instance of the adapter factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MappingAdapterFactory() {
if (modelPackage == null) {
modelPackage = MappingPackage.eINSTANCE;
}
}
/**
* Returns whether this factory is applicable for the type of the object.
* <!-- begin-user-doc -->
* This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
* <!-- end-user-doc -->
* @return whether this factory is applicable for the type of the object.
* @generated
*/
@Override
public boolean isFactoryForType(Object object) {
if (object == modelPackage) {
return true;
}
if (object instanceof EObject) {
return ((EObject)object).eClass().getEPackage() == modelPackage;
}
return false;
}
/**
* The switch that delegates to the <code>createXXX</code> methods.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MappingSwitch<Adapter> modelSwitch =
new MappingSwitch<Adapter>() {
@Override
public Adapter casePatternApplication(PatternApplication object) {
return createPatternApplicationAdapter();
}
@Override
public Adapter caseCardinalityValue(CardinalityValue object) {
return createCardinalityValueAdapter();
}
@Override
public Adapter casePortMapping(PortMapping object) {
return createPortMappingAdapter();
}
@Override
public Adapter caseGraphElementMapping(GraphElementMapping object) {
return createGraphElementMappingAdapter();
}
@Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
};
/**
* Creates an adapter for the <code>target</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param target the object to adapt.
* @return the adapter for the <code>target</code>.
* @generated
*/
@Override
public Adapter createAdapter(Notifier target) {
return modelSwitch.doSwitch((EObject)target);
}
/**
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.mapping.PatternApplication <em>Pattern Application</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see com.irtsaintexupery.pseim.mapping.PatternApplication
* @generated
*/
public Adapter createPatternApplicationAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.mapping.CardinalityValue <em>Cardinality Value</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see com.irtsaintexupery.pseim.mapping.CardinalityValue
* @generated
*/
public Adapter createCardinalityValueAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.mapping.PortMapping <em>Port Mapping</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see com.irtsaintexupery.pseim.mapping.PortMapping
* @generated
*/
public Adapter createPortMappingAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link com.irtsaintexupery.pseim.mapping.GraphElementMapping <em>Graph Element Mapping</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see com.irtsaintexupery.pseim.mapping.GraphElementMapping
* @generated
*/
public Adapter createGraphElementMappingAdapter() {
return null;
}
/**
* Creates a new adapter for the default case.
* <!-- begin-user-doc -->
* This default implementation returns null.
* <!-- end-user-doc -->
* @return the new adapter.
* @generated
*/
public Adapter createEObjectAdapter() {
return null;
}
} //MappingAdapterFactory

View File

@@ -0,0 +1,173 @@
/**
*/
package com.irtsaintexupery.pseim.mapping.util;
import com.irtsaintexupery.pseim.mapping.*;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
/**
* <!-- begin-user-doc -->
* The <b>Switch</b> for the model's inheritance hierarchy.
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
* to invoke the <code>caseXXX</code> method for each class of the model,
* starting with the actual class of the object
* and proceeding up the inheritance hierarchy
* until a non-null result is returned,
* which is the result of the switch.
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.MappingPackage
* @generated
*/
public class MappingSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static MappingPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MappingSwitch() {
if (modelPackage == null) {
modelPackage = MappingPackage.eINSTANCE;
}
}
/**
* Checks whether this is a switch for the given package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param ePackage the package in question.
* @return whether this is a switch for the given package.
* @generated
*/
@Override
protected boolean isSwitchFor(EPackage ePackage) {
return ePackage == modelPackage;
}
/**
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
@Override
protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case MappingPackage.PATTERN_APPLICATION: {
PatternApplication patternApplication = (PatternApplication)theEObject;
T result = casePatternApplication(patternApplication);
if (result == null) result = defaultCase(theEObject);
return result;
}
case MappingPackage.CARDINALITY_VALUE: {
CardinalityValue cardinalityValue = (CardinalityValue)theEObject;
T result = caseCardinalityValue(cardinalityValue);
if (result == null) result = defaultCase(theEObject);
return result;
}
case MappingPackage.PORT_MAPPING: {
PortMapping portMapping = (PortMapping)theEObject;
T result = casePortMapping(portMapping);
if (result == null) result = defaultCase(theEObject);
return result;
}
case MappingPackage.GRAPH_ELEMENT_MAPPING: {
GraphElementMapping graphElementMapping = (GraphElementMapping)theEObject;
T result = caseGraphElementMapping(graphElementMapping);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Pattern Application</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Pattern Application</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePatternApplication(PatternApplication object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Cardinality Value</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Cardinality Value</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseCardinalityValue(CardinalityValue object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Port Mapping</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Port Mapping</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePortMapping(PortMapping object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Graph Element Mapping</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Graph Element Mapping</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGraphElementMapping(GraphElementMapping object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch, but this is the last case anyway.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
@Override
public T defaultCase(EObject object) {
return null;
}
} //MappingSwitch

View File

@@ -0,0 +1,240 @@
/**
*/
package com.irtsaintexupery.pseim.mapping.util;
import java.util.Map;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.EObjectValidator;
import com.irtsaintexupery.pseim.mapping.CardinalityValue;
import com.irtsaintexupery.pseim.mapping.GraphElementMapping;
import com.irtsaintexupery.pseim.mapping.MappingPackage;
import com.irtsaintexupery.pseim.mapping.PatternApplication;
import com.irtsaintexupery.pseim.mapping.PortMapping;
import com.irtsaintexupery.pseim.pseim.Pattern;
import com.irtsaintexupery.pseim.seim.*;
/**
* <!-- begin-user-doc -->
* The <b>Validator</b> for the model.
* <!-- end-user-doc -->
* @see com.irtsaintexupery.pseim.mapping.MappingPackage
* @generated
*/
public class MappingValidator extends EObjectValidator {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final MappingValidator INSTANCE = new MappingValidator();
/**
* A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.emf.common.util.Diagnostic#getSource()
* @see org.eclipse.emf.common.util.Diagnostic#getCode()
* @generated
*/
public static final String DIAGNOSTIC_SOURCE = "com.irtsaintexupery.pseim.mapping";
/**
* A constant with a fixed name that can be used as the base value for additional hand written constants.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 0;
/**
* A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MappingValidator() {
super();
}
/**
* Returns the package of this validator switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EPackage getEPackage() {
return MappingPackage.eINSTANCE;
}
/**
* Calls <code>validateXXX</code> for the corresponding classifier of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) {
switch (classifierID) {
case MappingPackage.PATTERN_APPLICATION:
return validatePatternApplication((PatternApplication)value, diagnostics, context);
case MappingPackage.CARDINALITY_VALUE:
return validateCardinalityValue((CardinalityValue)value, diagnostics, context);
case MappingPackage.PORT_MAPPING:
return validatePortMapping((PortMapping)value, diagnostics, context);
case MappingPackage.GRAPH_ELEMENT_MAPPING:
return validateGraphElementMapping((GraphElementMapping)value, diagnostics, context);
default:
return true;
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validatePatternApplication(PatternApplication patternApplication, DiagnosticChain diagnostics, Map<Object, Object> context) {
if (!validate_NoCircularContainment(patternApplication, diagnostics, context)) return false;
boolean result = validate_EveryMultiplicityConforms(patternApplication, diagnostics, context);
if (result || diagnostics != null) result &= validate_EveryDataValueConforms(patternApplication, diagnostics, context);
if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(patternApplication, diagnostics, context);
if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(patternApplication, diagnostics, context);
if (result || diagnostics != null) result &= validate_EveryProxyResolves(patternApplication, diagnostics, context);
if (result || diagnostics != null) result &= validate_UniqueID(patternApplication, diagnostics, context);
if (result || diagnostics != null) result &= validate_EveryKeyUnique(patternApplication, diagnostics, context);
if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(patternApplication, diagnostics, context);
if (result || diagnostics != null) result &= validatePatternApplication_InvariantName(patternApplication, diagnostics, context);
return result;
}
/**
* The cached validation expression for the InvariantName constraint of '<em>Pattern Application</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static final String PATTERN_APPLICATION__INVARIANT_NAME__EEXPRESSION = "true";
/**
* Validates the InvariantName constraint of '<em>Pattern Application</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validatePatternApplication_InvariantName(PatternApplication patternApplication, DiagnosticChain diagnostics, Map<Object, Object> context) {
return
validate
(MappingPackage.Literals.PATTERN_APPLICATION,
patternApplication,
diagnostics,
context,
"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
"InvariantName",
PATTERN_APPLICATION__INVARIANT_NAME__EEXPRESSION,
Diagnostic.ERROR,
DIAGNOSTIC_SOURCE,
0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validateCardinalityValue(CardinalityValue cardinalityValue, DiagnosticChain diagnostics, Map<Object, Object> context) {
return validate_EveryDefaultConstraint(cardinalityValue, diagnostics, context);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public boolean validatePortMapping(PortMapping portMapping, DiagnosticChain diagnostics, Map<Object, Object> context) {
Model matchedModel = ((PatternApplication)portMapping.eContainer()).getModel();
TreeIterator<EObject> itM = matchedModel.eAllContents();
EList<BorderElement> ports = portMapping.getModelPort();
while (itM.hasNext()) {
Element current = (Element) itM.next();
if (ports.contains(current)) {
ports.remove(current);
}
}
Pattern matchedPattern = ((PatternApplication)portMapping.eContainer()).getPattern();
TreeIterator<EObject> itP = matchedPattern.eAllContents();
boolean patternFound = false;
while (itP.hasNext()) {
if (itP.next().equals(portMapping.getPatternPort())) {
patternFound = true;
break;
}
}
if (patternFound && ports.isEmpty())
return validate_EveryDefaultConstraint(portMapping, diagnostics, context);
else
return false;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public boolean validateGraphElementMapping(GraphElementMapping graphElementMapping, DiagnosticChain diagnostics, Map<Object, Object> context) {
Model matchedModel = ((PatternApplication)graphElementMapping.eContainer()).getModel();
TreeIterator<EObject> itM = matchedModel.eAllContents();
EList<GraphElement> elements = graphElementMapping.getModelGraphElement();
while (itM.hasNext()) {
Element current = (Element) itM.next();
if (elements.contains(current)) {
elements.remove(current);
}
}
Pattern matchedPattern = ((PatternApplication)graphElementMapping.eContainer()).getPattern();
TreeIterator<EObject> itP = matchedPattern.eAllContents();
boolean patternFound = false;
while (itP.hasNext()) {
if (itP.next().equals(graphElementMapping.getPatternGraphElement())) {
patternFound = true;
break;
}
}
if (patternFound && elements.isEmpty())
return validate_EveryDefaultConstraint(graphElementMapping, diagnostics, context);
else
return false;
}
/**
* Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
// TODO
// Specialize this to return a resource locator for messages specific to this validator.
// Ensure that you remove @generated or mark it @generated NOT
return super.getResourceLocator();
}
} //MappingValidator

View File

@@ -29,7 +29,7 @@ import com.irtsaintexupery.pseim.seim.Link;
*
* @see com.irtsaintexupery.pseim.pseim.PseimPackage#getPatternLink()
* @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='srcIsPatternPort dstIsPatternPort'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot srcIsPatternPort='src.oclIsTypeOf(PatternLink)' dstIsPatternPort='dst.oclIsTypeOf(PatternLink)'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot srcIsPatternPort='src.oclIsTypeOf(PatternPort)' dstIsPatternPort='dst.oclIsTypeOf(PatternPort)'"
* @generated
*/
public interface PatternLink extends IdentifiedElement, Link {

View File

@@ -787,8 +787,8 @@ public class PseimPackageImpl extends EPackageImpl implements PseimPackage {
String source = "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot";
addAnnotation(patternComponentEClass, source, new String[] { "contentIsPatternContent",
"content->forAll(c | c.oclIsTypeOf(PatternComponent) or c.oclIsTypeOf(PatternPort) or c.oclIsTypeOf(PatternLink))" });
addAnnotation(patternLinkEClass, source, new String[] { "srcIsPatternPort", "src.oclIsTypeOf(PatternLink)",
"dstIsPatternPort", "dst.oclIsTypeOf(PatternLink)" });
addAnnotation(patternLinkEClass, source, new String[] { "srcIsPatternPort", "src.oclIsTypeOf(PatternPort)",
"dstIsPatternPort", "dst.oclIsTypeOf(PatternPort)" });
addAnnotation(multiplicityElementEClass, source, new String[] { "cardinalityAsElementOrMult",
"(not (cardinalityElement.oclIsUndefined())) implies multiplicityValue = 1" });
}

View File

@@ -370,7 +370,7 @@ public class PseimValidator extends EObjectValidator {
* <!-- end-user-doc -->
* @generated
*/
protected static final String PATTERN_LINK__SRC_IS_PATTERN_PORT__EEXPRESSION = "src.oclIsTypeOf(PatternLink)";
protected static final String PATTERN_LINK__SRC_IS_PATTERN_PORT__EEXPRESSION = "src.oclIsTypeOf(PatternPort)";
/**
* Validates the srcIsPatternPort constraint of '<em>Pattern Link</em>'.
@@ -391,7 +391,7 @@ public class PseimValidator extends EObjectValidator {
* <!-- end-user-doc -->
* @generated
*/
protected static final String PATTERN_LINK__DST_IS_PATTERN_PORT__EEXPRESSION = "dst.oclIsTypeOf(PatternLink)";
protected static final String PATTERN_LINK__DST_IS_PATTERN_PORT__EEXPRESSION = "dst.oclIsTypeOf(PatternPort)";
/**
* Validates the dstIsPatternPort constraint of '<em>Pattern Link</em>'.

View File

@@ -45,7 +45,7 @@ public interface NamedElement extends IdentifiedElement {
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see com.irtsaintexupery.pseim.seim.SeimPackage#getNamedElement_Name()
* @model required="true"
* @model
* @generated
*/
String getName();

View File

@@ -693,7 +693,7 @@ public class SeimPackageImpl extends EPackageImpl implements SeimPackage {
initEClass(namedElementEClass, NamedElement.class, "NamedElement", IS_ABSTRACT, IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getNamedElement_Name(), ecorePackage.getEString(), "name", null, 1, 1, NamedElement.class,
initEAttribute(getNamedElement_Name(), ecorePackage.getEString(), "name", null, 0, 1, NamedElement.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(identifiedElementEClass, IdentifiedElement.class, "IdentifiedElement", IS_ABSTRACT, IS_INTERFACE,

View File

@@ -142,7 +142,7 @@ public class SeimValidator extends EObjectValidator {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @generated NOT
*/
public boolean validateComponent(Component component, DiagnosticChain diagnostics, Map<Object, Object> context) {
if (!validate_NoCircularContainment(component, diagnostics, context))
@@ -168,13 +168,15 @@ public class SeimValidator extends EObjectValidator {
result &= validateNamedElement_nameNotEmpty(component, diagnostics, context);
if (result || diagnostics != null)
result &= validatePropertyHolder_uniqueKeys(component, diagnostics, context);
if (result || diagnostics != null)
result &= (component.getName() != null);
return result;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @generated NOT
*/
public boolean validatePort(Port port, DiagnosticChain diagnostics, Map<Object, Object> context) {
if (!validate_NoCircularContainment(port, diagnostics, context))
@@ -200,6 +202,8 @@ public class SeimValidator extends EObjectValidator {
result &= validateNamedElement_nameNotEmpty(port, diagnostics, context);
if (result || diagnostics != null)
result &= validatePropertyHolder_uniqueKeys(port, diagnostics, context);
if (result || diagnostics != null)
result &= (port.getName() != null);
return result;
}
@@ -633,7 +637,7 @@ public class SeimValidator extends EObjectValidator {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @generated NOT
*/
public boolean validateModel(Model model, DiagnosticChain diagnostics, Map<Object, Object> context) {
if (!validate_NoCircularContainment(model, diagnostics, context))
@@ -659,6 +663,8 @@ public class SeimValidator extends EObjectValidator {
result &= validateNamedElement_nameNotEmpty(model, diagnostics, context);
if (result || diagnostics != null)
result &= validatePropertyHolder_uniqueKeys(model, diagnostics, context);
if (result || diagnostics != null)
result &= (model.getName() != null);
return result;
}