Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2008-04-17 07:58:49 -0400
committeratikhomirov2008-04-17 07:58:49 -0400
commit3c292d55cf97f453975db1e44049f12ad938f7f3 (patch)
tree0723dc3d8636d5f3e41313e977c81ddde8db3b39
parent6d5a317c2f5fb57aeab3b184763b6559649b0bb5 (diff)
downloadorg.eclipse.gmf-tooling-3c292d55cf97f453975db1e44049f12ad938f7f3.tar.gz
org.eclipse.gmf-tooling-3c292d55cf97f453975db1e44049f12ad938f7f3.tar.xz
org.eclipse.gmf-tooling-3c292d55cf97f453975db1e44049f12ad938f7f3.zip
[227505] Replace FeatureValueSpec generalization of ValueExpression with aggregation, as it's better approach to model such a concept
-rw-r--r--plugins/org.eclipse.gmf.map/models/gmfmap.ecore10
-rw-r--r--plugins/org.eclipse.gmf.map/models/gmfmap.genmodel4
-rw-r--r--plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/FeatureInitializer.java4
-rw-r--r--plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/FeatureValueSpec.java37
-rw-r--r--plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/GMFMapPackage.java47
-rw-r--r--plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/FeatureInitializerImpl.java261
-rw-r--r--plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/FeatureValueSpecImpl.java182
-rw-r--r--plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/GMFMapPackageImpl.java26
-rw-r--r--plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/ReferenceNewElementSpecImpl.java146
-rw-r--r--plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/util/GMFMapSwitch.java1
10 files changed, 374 insertions, 344 deletions
diff --git a/plugins/org.eclipse.gmf.map/models/gmfmap.ecore b/plugins/org.eclipse.gmf.map/models/gmfmap.ecore
index c0e24b52f..50e538038 100644
--- a/plugins/org.eclipse.gmf.map/models/gmfmap.ecore
+++ b/plugins/org.eclipse.gmf.map/models/gmfmap.ecore
@@ -382,8 +382,7 @@
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="FeatureInitializer" abstract="true"
- interface="true">
+ <eClassifiers xsi:type="ecore:EClass" name="FeatureInitializer" abstract="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="feature" lowerBound="1"
eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
@@ -409,17 +408,16 @@
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="FeatureValueSpec" eSuperTypes="#//ValueExpression #//FeatureInitializer">
+ <eClassifiers xsi:type="ecore:EClass" name="FeatureValueSpec" eSuperTypes="#//FeatureInitializer">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Value specification associated with a specific feature"/>
</eAnnotations>
<eAnnotations source="http://www.eclipse.org/gmf/2005/constraints/meta">
- <details key="def" value="ValueSpec"/>
- </eAnnotations>
- <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints/meta">
<details key="def" value="type"/>
<details key="ocl" value="feature"/>
</eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="value" lowerBound="1" eType="#//ValueExpression"
+ containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ReferenceNewElementSpec" eSuperTypes="#//FeatureInitializer">
<eAnnotations source="http://www.eclipse.org/gmf/2005/constraints">
diff --git a/plugins/org.eclipse.gmf.map/models/gmfmap.genmodel b/plugins/org.eclipse.gmf.map/models/gmfmap.genmodel
index 4a1c5de9f..249375f6f 100644
--- a/plugins/org.eclipse.gmf.map/models/gmfmap.genmodel
+++ b/plugins/org.eclipse.gmf.map/models/gmfmap.genmodel
@@ -131,7 +131,9 @@
<genFeatures createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference gmfmap.ecore#//FeatureInitializer/feature"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference gmfmap.ecore#//FeatureInitializer/featureSeqInitializer"/>
</genClasses>
- <genClasses ecoreClass="gmfmap.ecore#//FeatureValueSpec" labelFeature="#//mappings/ValueExpression/body"/>
+ <genClasses ecoreClass="gmfmap.ecore#//FeatureValueSpec">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference gmfmap.ecore#//FeatureValueSpec/value"/>
+ </genClasses>
<genClasses ecoreClass="gmfmap.ecore#//ReferenceNewElementSpec">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference gmfmap.ecore#//ReferenceNewElementSpec/newElementInitializers"/>
</genClasses>
diff --git a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/FeatureInitializer.java b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/FeatureInitializer.java
index 4c1da2cb6..b0060f037 100644
--- a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/FeatureInitializer.java
+++ b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/FeatureInitializer.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: FeatureInitializer.java,v 1.4 2008/03/04 16:50:29 atikhomirov Exp $
+ * $Id: FeatureInitializer.java,v 1.5 2008/04/17 11:58:49 atikhomirov Exp $
*/
package org.eclipse.gmf.mappings;
@@ -23,7 +23,7 @@ import org.eclipse.emf.ecore.EStructuralFeature;
* </p>
*
* @see org.eclipse.gmf.mappings.GMFMapPackage#getFeatureInitializer()
- * @model interface="true" abstract="true"
+ * @model abstract="true"
* @generated
*/
public interface FeatureInitializer extends EObject {
diff --git a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/FeatureValueSpec.java b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/FeatureValueSpec.java
index 5c00675eb..701806571 100644
--- a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/FeatureValueSpec.java
+++ b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/FeatureValueSpec.java
@@ -16,11 +16,42 @@ package org.eclipse.gmf.mappings;
* Value specification associated with a specific feature
* <!-- end-model-doc -->
*
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.mappings.FeatureValueSpec#getValue <em>Value</em>}</li>
+ * </ul>
+ * </p>
*
* @see org.eclipse.gmf.mappings.GMFMapPackage#getFeatureValueSpec()
- * @model annotation="http://www.eclipse.org/gmf/2005/constraints/meta def='ValueSpec'"
- * annotation="http://www.eclipse.org/gmf/2005/constraints/meta def='type' ocl='feature'"
+ * @model annotation="http://www.eclipse.org/gmf/2005/constraints/meta def='type' ocl='feature'"
* @generated
*/
-public interface FeatureValueSpec extends ValueExpression, FeatureInitializer {
+public interface FeatureValueSpec extends FeatureInitializer {
+
+ /**
+ * Returns the value of the '<em><b>Value</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Value</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Value</em>' containment reference.
+ * @see #setValue(ValueExpression)
+ * @see org.eclipse.gmf.mappings.GMFMapPackage#getFeatureValueSpec_Value()
+ * @model containment="true" required="true"
+ * @generated
+ */
+ ValueExpression getValue();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.mappings.FeatureValueSpec#getValue <em>Value</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Value</em>' containment reference.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(ValueExpression value);
} // FeatureValueSpec
diff --git a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/GMFMapPackage.java b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/GMFMapPackage.java
index 959feace3..b1e0114ed 100644
--- a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/GMFMapPackage.java
+++ b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/GMFMapPackage.java
@@ -1199,10 +1199,10 @@ public interface GMFMapPackage extends EPackage {
int FEATURE_SEQ_INITIALIZER_FEATURE_COUNT = ELEMENT_INITIALIZER_FEATURE_COUNT + 3;
/**
- * The meta object id for the '{@link org.eclipse.gmf.mappings.FeatureInitializer <em>Feature Initializer</em>}' class.
+ * The meta object id for the '{@link org.eclipse.gmf.mappings.impl.FeatureInitializerImpl <em>Feature Initializer</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.gmf.mappings.FeatureInitializer
+ * @see org.eclipse.gmf.mappings.impl.FeatureInitializerImpl
* @see org.eclipse.gmf.mappings.impl.GMFMapPackageImpl#getFeatureInitializer()
* @generated
*/
@@ -1246,49 +1246,31 @@ public interface GMFMapPackage extends EPackage {
int FEATURE_VALUE_SPEC = 19;
/**
- * The feature id for the '<em><b>Body</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int FEATURE_VALUE_SPEC__BODY = VALUE_EXPRESSION__BODY;
-
- /**
- * The feature id for the '<em><b>Language</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int FEATURE_VALUE_SPEC__LANGUAGE = VALUE_EXPRESSION__LANGUAGE;
-
- /**
- * The feature id for the '<em><b>Lang Name</b></em>' attribute.
+ * The feature id for the '<em><b>Feature</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int FEATURE_VALUE_SPEC__LANG_NAME = VALUE_EXPRESSION__LANG_NAME;
+ int FEATURE_VALUE_SPEC__FEATURE = FEATURE_INITIALIZER__FEATURE;
/**
- * The feature id for the '<em><b>Feature</b></em>' reference.
+ * The feature id for the '<em><b>Feature Seq Initializer</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int FEATURE_VALUE_SPEC__FEATURE = VALUE_EXPRESSION_FEATURE_COUNT + 0;
+ int FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER = FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER;
/**
- * The feature id for the '<em><b>Feature Seq Initializer</b></em>' container reference.
+ * The feature id for the '<em><b>Value</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER = VALUE_EXPRESSION_FEATURE_COUNT + 1;
+ int FEATURE_VALUE_SPEC__VALUE = FEATURE_INITIALIZER_FEATURE_COUNT + 0;
/**
* The number of structural features of the '<em>Feature Value Spec</em>' class.
@@ -1297,7 +1279,7 @@ public interface GMFMapPackage extends EPackage {
* @generated
* @ordered
*/
- int FEATURE_VALUE_SPEC_FEATURE_COUNT = VALUE_EXPRESSION_FEATURE_COUNT + 2;
+ int FEATURE_VALUE_SPEC_FEATURE_COUNT = FEATURE_INITIALIZER_FEATURE_COUNT + 1;
/**
@@ -2795,6 +2777,17 @@ public interface GMFMapPackage extends EPackage {
EClass getFeatureValueSpec();
/**
+ * Returns the meta object for the containment reference '{@link org.eclipse.gmf.mappings.FeatureValueSpec#getValue <em>Value</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Value</em>'.
+ * @see org.eclipse.gmf.mappings.FeatureValueSpec#getValue()
+ * @see #getFeatureValueSpec()
+ * @generated
+ */
+ EReference getFeatureValueSpec_Value();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.gmf.mappings.ReferenceNewElementSpec <em>Reference New Element Spec</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/FeatureInitializerImpl.java b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/FeatureInitializerImpl.java
new file mode 100644
index 000000000..1547df286
--- /dev/null
+++ b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/FeatureInitializerImpl.java
@@ -0,0 +1,261 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.mappings.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.gmf.mappings.FeatureInitializer;
+import org.eclipse.gmf.mappings.FeatureSeqInitializer;
+import org.eclipse.gmf.mappings.GMFMapPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Feature Initializer</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.mappings.impl.FeatureInitializerImpl#getFeature <em>Feature</em>}</li>
+ * <li>{@link org.eclipse.gmf.mappings.impl.FeatureInitializerImpl#getFeatureSeqInitializer <em>Feature Seq Initializer</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public abstract class FeatureInitializerImpl extends EObjectImpl implements FeatureInitializer {
+ /**
+ * The cached value of the '{@link #getFeature() <em>Feature</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFeature()
+ * @generated
+ * @ordered
+ */
+ protected EStructuralFeature feature;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected FeatureInitializerImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GMFMapPackage.eINSTANCE.getFeatureInitializer();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EStructuralFeature getFeature() {
+ if (feature != null && feature.eIsProxy()) {
+ InternalEObject oldFeature = (InternalEObject)feature;
+ feature = (EStructuralFeature)eResolveProxy(oldFeature);
+ if (feature != oldFeature) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, GMFMapPackage.FEATURE_INITIALIZER__FEATURE, oldFeature, feature));
+ }
+ }
+ return feature;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EStructuralFeature basicGetFeature() {
+ return feature;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setFeature(EStructuralFeature newFeature) {
+ EStructuralFeature oldFeature = feature;
+ feature = newFeature;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GMFMapPackage.FEATURE_INITIALIZER__FEATURE, oldFeature, feature));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FeatureSeqInitializer getFeatureSeqInitializer() {
+ if (eContainerFeatureID != GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER) return null;
+ return (FeatureSeqInitializer)eContainer();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetFeatureSeqInitializer(FeatureSeqInitializer newFeatureSeqInitializer, NotificationChain msgs) {
+ msgs = eBasicSetContainer((InternalEObject)newFeatureSeqInitializer, GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER, msgs);
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setFeatureSeqInitializer(FeatureSeqInitializer newFeatureSeqInitializer) {
+ if (newFeatureSeqInitializer != eInternalContainer() || (eContainerFeatureID != GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER && newFeatureSeqInitializer != null)) {
+ if (EcoreUtil.isAncestor(this, newFeatureSeqInitializer))
+ throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+ NotificationChain msgs = null;
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ if (newFeatureSeqInitializer != null)
+ msgs = ((InternalEObject)newFeatureSeqInitializer).eInverseAdd(this, GMFMapPackage.FEATURE_SEQ_INITIALIZER__INITIALIZERS, FeatureSeqInitializer.class, msgs);
+ msgs = basicSetFeatureSeqInitializer(newFeatureSeqInitializer, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER, newFeatureSeqInitializer, newFeatureSeqInitializer));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER:
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ return basicSetFeatureSeqInitializer((FeatureSeqInitializer)otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER:
+ return basicSetFeatureSeqInitializer(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
+ switch (eContainerFeatureID) {
+ case GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER:
+ return eInternalContainer().eInverseRemove(this, GMFMapPackage.FEATURE_SEQ_INITIALIZER__INITIALIZERS, FeatureSeqInitializer.class, msgs);
+ }
+ return super.eBasicRemoveFromContainerFeature(msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GMFMapPackage.FEATURE_INITIALIZER__FEATURE:
+ if (resolve) return getFeature();
+ return basicGetFeature();
+ case GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER:
+ return getFeatureSeqInitializer();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GMFMapPackage.FEATURE_INITIALIZER__FEATURE:
+ setFeature((EStructuralFeature)newValue);
+ return;
+ case GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER:
+ setFeatureSeqInitializer((FeatureSeqInitializer)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GMFMapPackage.FEATURE_INITIALIZER__FEATURE:
+ setFeature((EStructuralFeature)null);
+ return;
+ case GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER:
+ setFeatureSeqInitializer((FeatureSeqInitializer)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GMFMapPackage.FEATURE_INITIALIZER__FEATURE:
+ return feature != null;
+ case GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER:
+ return getFeatureSeqInitializer() != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //FeatureInitializerImpl
diff --git a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/FeatureValueSpecImpl.java b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/FeatureValueSpecImpl.java
index 149f37d99..7131eec98 100644
--- a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/FeatureValueSpecImpl.java
+++ b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/FeatureValueSpecImpl.java
@@ -9,14 +9,11 @@ package org.eclipse.gmf.mappings.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.gmf.mappings.FeatureInitializer;
-import org.eclipse.gmf.mappings.FeatureSeqInitializer;
import org.eclipse.gmf.mappings.FeatureValueSpec;
import org.eclipse.gmf.mappings.GMFMapPackage;
+import org.eclipse.gmf.mappings.ValueExpression;
/**
* <!-- begin-user-doc -->
@@ -25,24 +22,22 @@ import org.eclipse.gmf.mappings.GMFMapPackage;
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.gmf.mappings.impl.FeatureValueSpecImpl#getFeature <em>Feature</em>}</li>
- * <li>{@link org.eclipse.gmf.mappings.impl.FeatureValueSpecImpl#getFeatureSeqInitializer <em>Feature Seq Initializer</em>}</li>
+ * <li>{@link org.eclipse.gmf.mappings.impl.FeatureValueSpecImpl#getValue <em>Value</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public class FeatureValueSpecImpl extends ValueExpressionImpl implements FeatureValueSpec {
+public class FeatureValueSpecImpl extends FeatureInitializerImpl implements FeatureValueSpec {
/**
- * The cached value of the '{@link #getFeature() <em>Feature</em>}' reference.
+ * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see #getFeature()
+ * @see #getValue()
* @generated
* @ordered
*/
- protected EStructuralFeature feature;
-
+ protected ValueExpression value;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -67,37 +62,8 @@ public class FeatureValueSpecImpl extends ValueExpressionImpl implements Feature
* <!-- end-user-doc -->
* @generated
*/
- public EStructuralFeature getFeature() {
- if (feature != null && feature.eIsProxy()) {
- InternalEObject oldFeature = (InternalEObject)feature;
- feature = (EStructuralFeature)eResolveProxy(oldFeature);
- if (feature != oldFeature) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE, oldFeature, feature));
- }
- }
- return feature;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EStructuralFeature basicGetFeature() {
- return feature;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setFeature(EStructuralFeature newFeature) {
- EStructuralFeature oldFeature = feature;
- feature = newFeature;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE, oldFeature, feature));
+ public ValueExpression getValue() {
+ return value;
}
/**
@@ -105,18 +71,13 @@ public class FeatureValueSpecImpl extends ValueExpressionImpl implements Feature
* <!-- end-user-doc -->
* @generated
*/
- public FeatureSeqInitializer getFeatureSeqInitializer() {
- if (eContainerFeatureID != GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER) return null;
- return (FeatureSeqInitializer)eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetFeatureSeqInitializer(FeatureSeqInitializer newFeatureSeqInitializer, NotificationChain msgs) {
- msgs = eBasicSetContainer((InternalEObject)newFeatureSeqInitializer, GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER, msgs);
+ public NotificationChain basicSetValue(ValueExpression newValue, NotificationChain msgs) {
+ ValueExpression oldValue = value;
+ value = newValue;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GMFMapPackage.FEATURE_VALUE_SPEC__VALUE, oldValue, newValue);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
return msgs;
}
@@ -125,36 +86,18 @@ public class FeatureValueSpecImpl extends ValueExpressionImpl implements Feature
* <!-- end-user-doc -->
* @generated
*/
- public void setFeatureSeqInitializer(FeatureSeqInitializer newFeatureSeqInitializer) {
- if (newFeatureSeqInitializer != eInternalContainer() || (eContainerFeatureID != GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER && newFeatureSeqInitializer != null)) {
- if (EcoreUtil.isAncestor(this, newFeatureSeqInitializer))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+ public void setValue(ValueExpression newValue) {
+ if (newValue != value) {
NotificationChain msgs = null;
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newFeatureSeqInitializer != null)
- msgs = ((InternalEObject)newFeatureSeqInitializer).eInverseAdd(this, GMFMapPackage.FEATURE_SEQ_INITIALIZER__INITIALIZERS, FeatureSeqInitializer.class, msgs);
- msgs = basicSetFeatureSeqInitializer(newFeatureSeqInitializer, msgs);
+ if (value != null)
+ msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GMFMapPackage.FEATURE_VALUE_SPEC__VALUE, null, msgs);
+ if (newValue != null)
+ msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GMFMapPackage.FEATURE_VALUE_SPEC__VALUE, null, msgs);
+ msgs = basicSetValue(newValue, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER, newFeatureSeqInitializer, newFeatureSeqInitializer));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER:
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return basicSetFeatureSeqInitializer((FeatureSeqInitializer)otherEnd, msgs);
- }
- return super.eInverseAdd(otherEnd, featureID, msgs);
+ eNotify(new ENotificationImpl(this, Notification.SET, GMFMapPackage.FEATURE_VALUE_SPEC__VALUE, newValue, newValue));
}
/**
@@ -165,8 +108,8 @@ public class FeatureValueSpecImpl extends ValueExpressionImpl implements Feature
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER:
- return basicSetFeatureSeqInitializer(null, msgs);
+ case GMFMapPackage.FEATURE_VALUE_SPEC__VALUE:
+ return basicSetValue(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@@ -177,27 +120,10 @@ public class FeatureValueSpecImpl extends ValueExpressionImpl implements Feature
* @generated
*/
@Override
- public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
- switch (eContainerFeatureID) {
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER:
- return eInternalContainer().eInverseRemove(this, GMFMapPackage.FEATURE_SEQ_INITIALIZER__INITIALIZERS, FeatureSeqInitializer.class, msgs);
- }
- return super.eBasicRemoveFromContainerFeature(msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE:
- if (resolve) return getFeature();
- return basicGetFeature();
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER:
- return getFeatureSeqInitializer();
+ case GMFMapPackage.FEATURE_VALUE_SPEC__VALUE:
+ return getValue();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -210,11 +136,8 @@ public class FeatureValueSpecImpl extends ValueExpressionImpl implements Feature
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE:
- setFeature((EStructuralFeature)newValue);
- return;
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER:
- setFeatureSeqInitializer((FeatureSeqInitializer)newValue);
+ case GMFMapPackage.FEATURE_VALUE_SPEC__VALUE:
+ setValue((ValueExpression)newValue);
return;
}
super.eSet(featureID, newValue);
@@ -228,11 +151,8 @@ public class FeatureValueSpecImpl extends ValueExpressionImpl implements Feature
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE:
- setFeature((EStructuralFeature)null);
- return;
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER:
- setFeatureSeqInitializer((FeatureSeqInitializer)null);
+ case GMFMapPackage.FEATURE_VALUE_SPEC__VALUE:
+ setValue((ValueExpression)null);
return;
}
super.eUnset(featureID);
@@ -246,46 +166,10 @@ public class FeatureValueSpecImpl extends ValueExpressionImpl implements Feature
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE:
- return feature != null;
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER:
- return getFeatureSeqInitializer() != null;
+ case GMFMapPackage.FEATURE_VALUE_SPEC__VALUE:
+ return value != null;
}
return super.eIsSet(featureID);
}
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
- if (baseClass == FeatureInitializer.class) {
- switch (derivedFeatureID) {
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE: return GMFMapPackage.FEATURE_INITIALIZER__FEATURE;
- case GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER: return GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
- if (baseClass == FeatureInitializer.class) {
- switch (baseFeatureID) {
- case GMFMapPackage.FEATURE_INITIALIZER__FEATURE: return GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE;
- case GMFMapPackage.FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER: return GMFMapPackage.FEATURE_VALUE_SPEC__FEATURE_SEQ_INITIALIZER;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
} //FeatureValueSpecImpl
diff --git a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/GMFMapPackageImpl.java b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/GMFMapPackageImpl.java
index 0a2fefe40..504d267a3 100644
--- a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/GMFMapPackageImpl.java
+++ b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/GMFMapPackageImpl.java
@@ -11,8 +11,8 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.EValidator;
+import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.gmf.gmfgraph.GMFGraphPackage;
import org.eclipse.gmf.mappings.*;
@@ -1067,6 +1067,15 @@ public class GMFMapPackageImpl extends EPackageImpl implements GMFMapPackage {
* <!-- end-user-doc -->
* @generated
*/
+ public EReference getFeatureValueSpec_Value() {
+ return (EReference)featureValueSpecEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getReferenceNewElementSpec() {
return referenceNewElementSpecEClass;
}
@@ -1644,6 +1653,7 @@ public class GMFMapPackageImpl extends EPackageImpl implements GMFMapPackage {
createEReference(featureInitializerEClass, FEATURE_INITIALIZER__FEATURE_SEQ_INITIALIZER);
featureValueSpecEClass = createEClass(FEATURE_VALUE_SPEC);
+ createEReference(featureValueSpecEClass, FEATURE_VALUE_SPEC__VALUE);
referenceNewElementSpecEClass = createEClass(REFERENCE_NEW_ELEMENT_SPEC);
createEReference(referenceNewElementSpecEClass, REFERENCE_NEW_ELEMENT_SPEC__NEW_ELEMENT_INITIALIZERS);
@@ -1763,7 +1773,6 @@ public class GMFMapPackageImpl extends EPackageImpl implements GMFMapPackage {
designLabelMappingEClass.getESuperTypes().add(this.getLabelMapping());
constraintEClass.getESuperTypes().add(this.getValueExpression());
featureSeqInitializerEClass.getESuperTypes().add(this.getElementInitializer());
- featureValueSpecEClass.getESuperTypes().add(this.getValueExpression());
featureValueSpecEClass.getESuperTypes().add(this.getFeatureInitializer());
referenceNewElementSpecEClass.getESuperTypes().add(this.getFeatureInitializer());
auditRuleEClass.getESuperTypes().add(this.getRuleBase());
@@ -1870,11 +1879,12 @@ public class GMFMapPackageImpl extends EPackageImpl implements GMFMapPackage {
initEReference(getFeatureSeqInitializer_ElementClass(), ecorePackage.getEClass(), null, "elementClass", null, 0, 1, FeatureSeqInitializer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getFeatureSeqInitializer_CreatingInitializer(), this.getReferenceNewElementSpec(), this.getReferenceNewElementSpec_NewElementInitializers(), "creatingInitializer", null, 0, 1, FeatureSeqInitializer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEClass(featureInitializerEClass, FeatureInitializer.class, "FeatureInitializer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEClass(featureInitializerEClass, FeatureInitializer.class, "FeatureInitializer", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getFeatureInitializer_Feature(), ecorePackage.getEStructuralFeature(), null, "feature", null, 1, 1, FeatureInitializer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getFeatureInitializer_FeatureSeqInitializer(), this.getFeatureSeqInitializer(), this.getFeatureSeqInitializer_Initializers(), "featureSeqInitializer", null, 1, 1, FeatureInitializer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(featureValueSpecEClass, FeatureValueSpec.class, "FeatureValueSpec", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getFeatureValueSpec_Value(), this.getValueExpression(), null, "value", null, 1, 1, FeatureValueSpec.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(referenceNewElementSpecEClass, ReferenceNewElementSpec.class, "ReferenceNewElementSpec", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getReferenceNewElementSpec_NewElementInitializers(), this.getFeatureSeqInitializer(), this.getFeatureSeqInitializer_CreatingInitializer(), "newElementInitializers", null, 1, -1, ReferenceNewElementSpec.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -1984,7 +1994,7 @@ public class GMFMapPackageImpl extends EPackageImpl implements GMFMapPackage {
new String[] {
"constraints", "http://www.eclipse.org/gmf/2005/constraints",
"constraintsMeta", "http://www.eclipse.org/gmf/2005/constraints/meta"
- });
+ });
}
/**
@@ -2067,12 +2077,6 @@ public class GMFMapPackageImpl extends EPackageImpl implements GMFMapPackage {
(featureValueSpecEClass,
source,
new String[] {
- "def", "ValueSpec"
- });
- addAnnotation
- (featureValueSpecEClass,
- source,
- new String[] {
"def", "type",
"ocl", "feature"
});
@@ -2315,7 +2319,7 @@ public class GMFMapPackageImpl extends EPackageImpl implements GMFMapPackage {
new String[] {
"ocl", "feature <> null implies feature.changeable",
"description", "The \'feature\' of \'FeatureInitializer\' must be changeable"
- });
+ });
addAnnotation
(referenceNewElementSpecEClass,
source,
diff --git a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/ReferenceNewElementSpecImpl.java b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/ReferenceNewElementSpecImpl.java
index 8d367b35b..dcc1bceec 100644
--- a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/ReferenceNewElementSpecImpl.java
+++ b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/impl/ReferenceNewElementSpecImpl.java
@@ -2,28 +2,18 @@
* <copyright>
* </copyright>
*
- * $Id: ReferenceNewElementSpecImpl.java,v 1.4 2008/03/04 16:50:29 atikhomirov Exp $
+ * $Id: ReferenceNewElementSpecImpl.java,v 1.5 2008/04/17 11:58:49 atikhomirov Exp $
*/
package org.eclipse.gmf.mappings.impl;
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.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;
-
import org.eclipse.gmf.mappings.FeatureSeqInitializer;
import org.eclipse.gmf.mappings.GMFMapPackage;
import org.eclipse.gmf.mappings.ReferenceNewElementSpec;
@@ -35,25 +25,13 @@ import org.eclipse.gmf.mappings.ReferenceNewElementSpec;
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.gmf.mappings.impl.ReferenceNewElementSpecImpl#getFeature <em>Feature</em>}</li>
- * <li>{@link org.eclipse.gmf.mappings.impl.ReferenceNewElementSpecImpl#getFeatureSeqInitializer <em>Feature Seq Initializer</em>}</li>
* <li>{@link org.eclipse.gmf.mappings.impl.ReferenceNewElementSpecImpl#getNewElementInitializers <em>New Element Initializers</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public class ReferenceNewElementSpecImpl extends EObjectImpl implements ReferenceNewElementSpec {
- /**
- * The cached value of the '{@link #getFeature() <em>Feature</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFeature()
- * @generated
- * @ordered
- */
- protected EStructuralFeature feature;
-
+public class ReferenceNewElementSpecImpl extends FeatureInitializerImpl implements ReferenceNewElementSpec {
/**
* The cached value of the '{@link #getNewElementInitializers() <em>New Element Initializers</em>}' containment reference list.
* <!-- begin-user-doc -->
@@ -88,85 +66,6 @@ public class ReferenceNewElementSpecImpl extends EObjectImpl implements Referenc
* <!-- end-user-doc -->
* @generated
*/
- public EStructuralFeature getFeature() {
- if (feature != null && feature.eIsProxy()) {
- InternalEObject oldFeature = (InternalEObject)feature;
- feature = (EStructuralFeature)eResolveProxy(oldFeature);
- if (feature != oldFeature) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE, oldFeature, feature));
- }
- }
- return feature;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EStructuralFeature basicGetFeature() {
- return feature;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setFeature(EStructuralFeature newFeature) {
- EStructuralFeature oldFeature = feature;
- feature = newFeature;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE, oldFeature, feature));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public FeatureSeqInitializer getFeatureSeqInitializer() {
- if (eContainerFeatureID != GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE_SEQ_INITIALIZER) return null;
- return (FeatureSeqInitializer)eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetFeatureSeqInitializer(FeatureSeqInitializer newFeatureSeqInitializer, NotificationChain msgs) {
- msgs = eBasicSetContainer((InternalEObject)newFeatureSeqInitializer, GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE_SEQ_INITIALIZER, msgs);
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setFeatureSeqInitializer(FeatureSeqInitializer newFeatureSeqInitializer) {
- if (newFeatureSeqInitializer != eInternalContainer() || (eContainerFeatureID != GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE_SEQ_INITIALIZER && newFeatureSeqInitializer != null)) {
- if (EcoreUtil.isAncestor(this, newFeatureSeqInitializer))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
- NotificationChain msgs = null;
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newFeatureSeqInitializer != null)
- msgs = ((InternalEObject)newFeatureSeqInitializer).eInverseAdd(this, GMFMapPackage.FEATURE_SEQ_INITIALIZER__INITIALIZERS, FeatureSeqInitializer.class, msgs);
- msgs = basicSetFeatureSeqInitializer(newFeatureSeqInitializer, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE_SEQ_INITIALIZER, newFeatureSeqInitializer, newFeatureSeqInitializer));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
public EList<FeatureSeqInitializer> getNewElementInitializers() {
if (newElementInitializers == null) {
newElementInitializers = new EObjectContainmentWithInverseEList<FeatureSeqInitializer>(FeatureSeqInitializer.class, this, GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__NEW_ELEMENT_INITIALIZERS, GMFMapPackage.FEATURE_SEQ_INITIALIZER__CREATING_INITIALIZER);
@@ -183,10 +82,6 @@ public class ReferenceNewElementSpecImpl extends EObjectImpl implements Referenc
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
- case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE_SEQ_INITIALIZER:
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return basicSetFeatureSeqInitializer((FeatureSeqInitializer)otherEnd, msgs);
case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__NEW_ELEMENT_INITIALIZERS:
return ((InternalEList<InternalEObject>)(InternalEList<?>)getNewElementInitializers()).basicAdd(otherEnd, msgs);
}
@@ -201,8 +96,6 @@ public class ReferenceNewElementSpecImpl extends EObjectImpl implements Referenc
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
- case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE_SEQ_INITIALIZER:
- return basicSetFeatureSeqInitializer(null, msgs);
case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__NEW_ELEMENT_INITIALIZERS:
return ((InternalEList<?>)getNewElementInitializers()).basicRemove(otherEnd, msgs);
}
@@ -215,27 +108,8 @@ public class ReferenceNewElementSpecImpl extends EObjectImpl implements Referenc
* @generated
*/
@Override
- public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
- switch (eContainerFeatureID) {
- case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE_SEQ_INITIALIZER:
- return eInternalContainer().eInverseRemove(this, GMFMapPackage.FEATURE_SEQ_INITIALIZER__INITIALIZERS, FeatureSeqInitializer.class, msgs);
- }
- return super.eBasicRemoveFromContainerFeature(msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE:
- if (resolve) return getFeature();
- return basicGetFeature();
- case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE_SEQ_INITIALIZER:
- return getFeatureSeqInitializer();
case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__NEW_ELEMENT_INITIALIZERS:
return getNewElementInitializers();
}
@@ -251,12 +125,6 @@ public class ReferenceNewElementSpecImpl extends EObjectImpl implements Referenc
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE:
- setFeature((EStructuralFeature)newValue);
- return;
- case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE_SEQ_INITIALIZER:
- setFeatureSeqInitializer((FeatureSeqInitializer)newValue);
- return;
case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__NEW_ELEMENT_INITIALIZERS:
getNewElementInitializers().clear();
getNewElementInitializers().addAll((Collection<? extends FeatureSeqInitializer>)newValue);
@@ -273,12 +141,6 @@ public class ReferenceNewElementSpecImpl extends EObjectImpl implements Referenc
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE:
- setFeature((EStructuralFeature)null);
- return;
- case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE_SEQ_INITIALIZER:
- setFeatureSeqInitializer((FeatureSeqInitializer)null);
- return;
case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__NEW_ELEMENT_INITIALIZERS:
getNewElementInitializers().clear();
return;
@@ -294,10 +156,6 @@ public class ReferenceNewElementSpecImpl extends EObjectImpl implements Referenc
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE:
- return feature != null;
- case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__FEATURE_SEQ_INITIALIZER:
- return getFeatureSeqInitializer() != null;
case GMFMapPackage.REFERENCE_NEW_ELEMENT_SPEC__NEW_ELEMENT_INITIALIZERS:
return newElementInitializers != null && !newElementInitializers.isEmpty();
}
diff --git a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/util/GMFMapSwitch.java b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/util/GMFMapSwitch.java
index 89a2b228c..8cbc7557a 100644
--- a/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/util/GMFMapSwitch.java
+++ b/plugins/org.eclipse.gmf.map/src/org/eclipse/gmf/mappings/util/GMFMapSwitch.java
@@ -245,7 +245,6 @@ public class GMFMapSwitch<T> {
case GMFMapPackage.FEATURE_VALUE_SPEC: {
FeatureValueSpec featureValueSpec = (FeatureValueSpec)theEObject;
T result = caseFeatureValueSpec(featureValueSpec);
- if (result == null) result = caseValueExpression(featureValueSpec);
if (result == null) result = caseFeatureInitializer(featureValueSpec);
if (result == null) result = defaultCase(theEObject);
return result;

Back to the top