mirror of
http://172.16.200.102/MOISE/Pattern-Instanciation-On-System-Engineering-Model.git
synced 2025-12-18 10:23:57 +01:00
Added mapping metamodel and generated code.
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user