diff options
author | Christian W. Damus | 2013-04-09 14:40:40 +0000 |
---|---|---|
committer | Christian W. Damus | 2013-04-10 19:21:01 +0000 |
commit | bf7ea53f7b718195a08432cdca2f6b910d512334 (patch) | |
tree | 83dc1cd2ec49414595f0a353af2d25294f85fa7c | |
parent | a9f55ebde6708eeb40aa67e384bc950b8c2c18aa (diff) | |
download | cdo-bf7ea53f7b718195a08432cdca2f6b910d512334.tar.gz cdo-bf7ea53f7b718195a08432cdca2f6b910d512334.tar.xz cdo-bf7ea53f7b718195a08432cdca2f6b910d512334.zip |
[400236] [Legacy] ClassCastException on CDOLegacyWrapper when native reference legacy
https://bugs.eclipse.org/bugs/show_bug.cgi?id=400236
New test model for various kinds of native->legacy references.
18 files changed, 1288 insertions, 54 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/model/model6.ecore b/plugins/org.eclipse.emf.cdo.tests.model6/model/model6.ecore index 6420f25e31..8837188bc7 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/model/model6.ecore +++ b/plugins/org.eclipse.emf.cdo.tests.model6/model/model6.ecore @@ -179,4 +179,13 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="attrString" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" unsettable="true"/> </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="CanReferenceLegacy"> + <eStructuralFeatures xsi:type="ecore:EReference" name="singleContainment" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject" + containment="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="multipleContainment" upperBound="-1" + eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject" containment="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="singleReference" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="multipleReference" upperBound="-1" + eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/> + </eClassifiers> </ecore:EPackage> diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/model/model6.genmodel b/plugins/org.eclipse.emf.cdo.tests.model6/model/model6.genmodel index df1e850004..bcafd6ca9c 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/model/model6.genmodel +++ b/plugins/org.eclipse.emf.cdo.tests.model6/model/model6.genmodel @@ -127,5 +127,11 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model6.ecore#//UnsettableAttributes/attrShortObject"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model6.ecore#//UnsettableAttributes/attrString"/> </genClasses> + <genClasses ecoreClass="model6.ecore#//CanReferenceLegacy"> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference model6.ecore#//CanReferenceLegacy/singleContainment"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference model6.ecore#//CanReferenceLegacy/multipleContainment"/> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference model6.ecore#//CanReferenceLegacy/singleReference"/> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference model6.ecore#//CanReferenceLegacy/multipleReference"/> + </genClasses> </genPackages> </genmodel:GenModel> diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/model/model6.legacy.genmodel b/plugins/org.eclipse.emf.cdo.tests.model6/model/model6.legacy.genmodel index 5e2c469685..ac021680c4 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/model/model6.legacy.genmodel +++ b/plugins/org.eclipse.emf.cdo.tests.model6/model/model6.legacy.genmodel @@ -125,5 +125,11 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model6.ecore#//UnsettableAttributes/attrShortObject"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model6.ecore#//UnsettableAttributes/attrString"/> </genClasses> + <genClasses ecoreClass="model6.ecore#//CanReferenceLegacy"> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference model6.ecore#//CanReferenceLegacy/singleContainment"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference model6.ecore#//CanReferenceLegacy/multipleContainment"/> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference model6.ecore#//CanReferenceLegacy/singleReference"/> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference model6.ecore#//CanReferenceLegacy/multipleReference"/> + </genClasses> </genPackages> </genmodel:GenModel> diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/CanReferenceLegacy.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/CanReferenceLegacy.java new file mode 100644 index 0000000000..097575bc6d --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/CanReferenceLegacy.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - initial API and implementation + */ +package org.eclipse.emf.cdo.tests.model6; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Can Reference Legacy</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getSingleContainment <em>Single Containment</em>}</li> + * <li>{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getMultipleContainment <em>Multiple Containment</em>}</li> + * <li>{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getSingleReference <em>Single Reference</em>}</li> + * <li>{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getMultipleReference <em>Multiple Reference</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.cdo.tests.model6.Model6Package#getCanReferenceLegacy() + * @model + * @generated + */ +public interface CanReferenceLegacy extends EObject +{ + /** + * Returns the value of the '<em><b>Single Containment</b></em>' containment reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Single Containment</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>Single Containment</em>' containment reference. + * @see #setSingleContainment(EObject) + * @see org.eclipse.emf.cdo.tests.model6.Model6Package#getCanReferenceLegacy_SingleContainment() + * @model containment="true" resolveProxies="true" + * @generated + */ + EObject getSingleContainment(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getSingleContainment <em>Single Containment</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Single Containment</em>' containment reference. + * @see #getSingleContainment() + * @generated + */ + void setSingleContainment(EObject value); + + /** + * Returns the value of the '<em><b>Multiple Containment</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EObject}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Multiple Containment</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Multiple Containment</em>' containment reference list. + * @see org.eclipse.emf.cdo.tests.model6.Model6Package#getCanReferenceLegacy_MultipleContainment() + * @model containment="true" resolveProxies="true" + * @generated + */ + EList<EObject> getMultipleContainment(); + + /** + * Returns the value of the '<em><b>Single Reference</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Single Reference</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Single Reference</em>' reference. + * @see #setSingleReference(EObject) + * @see org.eclipse.emf.cdo.tests.model6.Model6Package#getCanReferenceLegacy_SingleReference() + * @model + * @generated + */ + EObject getSingleReference(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getSingleReference <em>Single Reference</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Single Reference</em>' reference. + * @see #getSingleReference() + * @generated + */ + void setSingleReference(EObject value); + + /** + * Returns the value of the '<em><b>Multiple Reference</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EObject}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Multiple Reference</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Multiple Reference</em>' reference list. + * @see org.eclipse.emf.cdo.tests.model6.Model6Package#getCanReferenceLegacy_MultipleReference() + * @model + * @generated + */ + EList<EObject> getMultipleReference(); + +} // CanReferenceLegacy diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/Model6Factory.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/Model6Factory.java index 2366a37e31..35d06462c3 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/Model6Factory.java +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/Model6Factory.java @@ -215,11 +215,20 @@ public interface Model6Factory extends EFactory UnsettableAttributes createUnsettableAttributes(); /** - * Returns the package supported by this factory. - * <!-- begin-user-doc --> <!-- end-user-doc --> - * @return the package supported by this factory. + * Returns a new object of class '<em>Can Reference Legacy</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Can Reference Legacy</em>'. * @generated */ + CanReferenceLegacy createCanReferenceLegacy(); + + /** + * Returns the package supported by this factory. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @return the package supported by this factory. + * @generated + */ Model6Package getModel6Package(); } // Model6Factory diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/Model6Package.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/Model6Package.java index af3b2d742a..7fcdd3e2d4 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/Model6Package.java +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/Model6Package.java @@ -1107,14 +1107,69 @@ public interface Model6Package extends EPackage int UNSETTABLE_ATTRIBUTES_FEATURE_COUNT = 23; /** - * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model6.MyEnum <em>My Enum</em>}' enum. + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model6.impl.CanReferenceLegacyImpl <em>Can Reference Legacy</em>}' class. * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.emf.cdo.tests.model6.MyEnum - * @see org.eclipse.emf.cdo.tests.model6.impl.Model6PackageImpl#getMyEnum() + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.tests.model6.impl.CanReferenceLegacyImpl + * @see org.eclipse.emf.cdo.tests.model6.impl.Model6PackageImpl#getCanReferenceLegacy() * @generated */ - int MY_ENUM = 24; + int CAN_REFERENCE_LEGACY = 24; + + /** + * The feature id for the '<em><b>Single Containment</b></em>' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT = 0; + + /** + * The feature id for the '<em><b>Multiple Containment</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CAN_REFERENCE_LEGACY__MULTIPLE_CONTAINMENT = 1; + + /** + * The feature id for the '<em><b>Single Reference</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CAN_REFERENCE_LEGACY__SINGLE_REFERENCE = 2; + + /** + * The feature id for the '<em><b>Multiple Reference</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CAN_REFERENCE_LEGACY__MULTIPLE_REFERENCE = 3; + + /** + * The number of structural features of the '<em>Can Reference Legacy</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CAN_REFERENCE_LEGACY_FEATURE_COUNT = 4; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model6.MyEnum <em>My Enum</em>}' enum. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.tests.model6.MyEnum + * @see org.eclipse.emf.cdo.tests.model6.impl.Model6PackageImpl#getMyEnum() + * @generated + */ + int MY_ENUM = 25; /** * The meta object id for the '<em>My String</em>' data type. @@ -1124,7 +1179,7 @@ public interface Model6Package extends EPackage * @see org.eclipse.emf.cdo.tests.model6.impl.Model6PackageImpl#getMyString() * @generated */ - int MY_STRING = 25; + int MY_STRING = 26; /** * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model6.Root <em>Root</em>}'. <!-- @@ -2005,13 +2060,67 @@ public interface Model6Package extends EPackage EAttribute getUnsettableAttributes_AttrString(); /** - * Returns the meta object for enum '{@link org.eclipse.emf.cdo.tests.model6.MyEnum <em>My Enum</em>}'. + * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy <em>Can Reference Legacy</em>}'. * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for enum '<em>My Enum</em>'. - * @see org.eclipse.emf.cdo.tests.model6.MyEnum + * <!-- end-user-doc --> + * @return the meta object for class '<em>Can Reference Legacy</em>'. + * @see org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy * @generated */ + EClass getCanReferenceLegacy(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getSingleContainment <em>Single Containment</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference '<em>Single Containment</em>'. + * @see org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getSingleContainment() + * @see #getCanReferenceLegacy() + * @generated + */ + EReference getCanReferenceLegacy_SingleContainment(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getMultipleContainment <em>Multiple Containment</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Multiple Containment</em>'. + * @see org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getMultipleContainment() + * @see #getCanReferenceLegacy() + * @generated + */ + EReference getCanReferenceLegacy_MultipleContainment(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getSingleReference <em>Single Reference</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Single Reference</em>'. + * @see org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getSingleReference() + * @see #getCanReferenceLegacy() + * @generated + */ + EReference getCanReferenceLegacy_SingleReference(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getMultipleReference <em>Multiple Reference</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Multiple Reference</em>'. + * @see org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getMultipleReference() + * @see #getCanReferenceLegacy() + * @generated + */ + EReference getCanReferenceLegacy_MultipleReference(); + + /** + * Returns the meta object for enum '{@link org.eclipse.emf.cdo.tests.model6.MyEnum <em>My Enum</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for enum '<em>My Enum</em>'. + * @see org.eclipse.emf.cdo.tests.model6.MyEnum + * @generated + */ EEnum getMyEnum(); /** @@ -2760,13 +2869,55 @@ public interface Model6Package extends EPackage EAttribute UNSETTABLE_ATTRIBUTES__ATTR_STRING = eINSTANCE.getUnsettableAttributes_AttrString(); /** - * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model6.MyEnum <em>My Enum</em>}' enum. + * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model6.impl.CanReferenceLegacyImpl <em>Can Reference Legacy</em>}' class. * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.emf.cdo.tests.model6.MyEnum - * @see org.eclipse.emf.cdo.tests.model6.impl.Model6PackageImpl#getMyEnum() + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.tests.model6.impl.CanReferenceLegacyImpl + * @see org.eclipse.emf.cdo.tests.model6.impl.Model6PackageImpl#getCanReferenceLegacy() * @generated */ + EClass CAN_REFERENCE_LEGACY = eINSTANCE.getCanReferenceLegacy(); + + /** + * The meta object literal for the '<em><b>Single Containment</b></em>' containment reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT = eINSTANCE.getCanReferenceLegacy_SingleContainment(); + + /** + * The meta object literal for the '<em><b>Multiple Containment</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference CAN_REFERENCE_LEGACY__MULTIPLE_CONTAINMENT = eINSTANCE.getCanReferenceLegacy_MultipleContainment(); + + /** + * The meta object literal for the '<em><b>Single Reference</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference CAN_REFERENCE_LEGACY__SINGLE_REFERENCE = eINSTANCE.getCanReferenceLegacy_SingleReference(); + + /** + * The meta object literal for the '<em><b>Multiple Reference</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference CAN_REFERENCE_LEGACY__MULTIPLE_REFERENCE = eINSTANCE.getCanReferenceLegacy_MultipleReference(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model6.MyEnum <em>My Enum</em>}' enum. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.tests.model6.MyEnum + * @see org.eclipse.emf.cdo.tests.model6.impl.Model6PackageImpl#getMyEnum() + * @generated + */ EEnum MY_ENUM = eINSTANCE.getMyEnum(); /** diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/impl/CanReferenceLegacyImpl.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/impl/CanReferenceLegacyImpl.java new file mode 100644 index 0000000000..1f44288b17 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/impl/CanReferenceLegacyImpl.java @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - initial API and implementation + */ +package org.eclipse.emf.cdo.tests.model6.impl; + +import org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy; +import org.eclipse.emf.cdo.tests.model6.Model6Package; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.internal.cdo.CDOObjectImpl; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Can Reference Legacy</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.cdo.tests.model6.impl.CanReferenceLegacyImpl#getSingleContainment <em>Single Containment</em>}</li> + * <li>{@link org.eclipse.emf.cdo.tests.model6.impl.CanReferenceLegacyImpl#getMultipleContainment <em>Multiple Containment</em>}</li> + * <li>{@link org.eclipse.emf.cdo.tests.model6.impl.CanReferenceLegacyImpl#getSingleReference <em>Single Reference</em>}</li> + * <li>{@link org.eclipse.emf.cdo.tests.model6.impl.CanReferenceLegacyImpl#getMultipleReference <em>Multiple Reference</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class CanReferenceLegacyImpl extends CDOObjectImpl implements CanReferenceLegacy +{ + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected CanReferenceLegacyImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return Model6Package.Literals.CAN_REFERENCE_LEGACY; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected int eStaticFeatureCount() + { + return 0; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EObject getSingleContainment() + { + return (EObject)eGet(Model6Package.Literals.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setSingleContainment(EObject newSingleContainment) + { + eSet(Model6Package.Literals.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT, newSingleContainment); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + public EList<EObject> getMultipleContainment() + { + return (EList<EObject>)eGet(Model6Package.Literals.CAN_REFERENCE_LEGACY__MULTIPLE_CONTAINMENT, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EObject getSingleReference() + { + return (EObject)eGet(Model6Package.Literals.CAN_REFERENCE_LEGACY__SINGLE_REFERENCE, true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setSingleReference(EObject newSingleReference) + { + eSet(Model6Package.Literals.CAN_REFERENCE_LEGACY__SINGLE_REFERENCE, newSingleReference); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + public EList<EObject> getMultipleReference() + { + return (EList<EObject>)eGet(Model6Package.Literals.CAN_REFERENCE_LEGACY__MULTIPLE_REFERENCE, true); + } + +} //CanReferenceLegacyImpl diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/impl/Model6FactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/impl/Model6FactoryImpl.java index 3e7ac1af55..6940c618ac 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/impl/Model6FactoryImpl.java +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/impl/Model6FactoryImpl.java @@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.tests.model6.A; import org.eclipse.emf.cdo.tests.model6.B; import org.eclipse.emf.cdo.tests.model6.BaseObject; import org.eclipse.emf.cdo.tests.model6.C; +import org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy; import org.eclipse.emf.cdo.tests.model6.ContainmentObject; import org.eclipse.emf.cdo.tests.model6.D; import org.eclipse.emf.cdo.tests.model6.E; @@ -141,6 +142,8 @@ public class Model6FactoryImpl extends EFactoryImpl implements Model6Factory return createEmptyStringDefaultUnsettable(); case Model6Package.UNSETTABLE_ATTRIBUTES: return createUnsettableAttributes(); + case Model6Package.CAN_REFERENCE_LEGACY: + return createCanReferenceLegacy(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -428,9 +431,20 @@ public class Model6FactoryImpl extends EFactoryImpl implements Model6Factory /** * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- end-user-doc --> * @generated */ + public CanReferenceLegacy createCanReferenceLegacy() + { + CanReferenceLegacyImpl canReferenceLegacy = new CanReferenceLegacyImpl(); + return canReferenceLegacy; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public MyEnum createMyEnumFromString(EDataType eDataType, String initialValue) { MyEnum result = MyEnum.get(initialValue); diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/impl/Model6PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/impl/Model6PackageImpl.java index ad05bfa2ea..fcdf4377cb 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/impl/Model6PackageImpl.java +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/impl/Model6PackageImpl.java @@ -11,6 +11,7 @@ package org.eclipse.emf.cdo.tests.model6.impl; import org.eclipse.emf.cdo.tests.model6.BaseObject; +import org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy; import org.eclipse.emf.cdo.tests.model6.ContainmentObject; import org.eclipse.emf.cdo.tests.model6.EmptyStringDefault; import org.eclipse.emf.cdo.tests.model6.EmptyStringDefaultUnsettable; @@ -206,9 +207,16 @@ public class Model6PackageImpl extends EPackageImpl implements Model6Package /** * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- end-user-doc --> * @generated */ + private EClass canReferenceLegacyEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ private EEnum myEnumEEnum = null; /** @@ -1081,9 +1089,59 @@ public class Model6PackageImpl extends EPackageImpl implements Model6Package /** * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- end-user-doc --> * @generated */ + public EClass getCanReferenceLegacy() + { + return canReferenceLegacyEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getCanReferenceLegacy_SingleContainment() + { + return (EReference)canReferenceLegacyEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getCanReferenceLegacy_MultipleContainment() + { + return (EReference)canReferenceLegacyEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getCanReferenceLegacy_SingleReference() + { + return (EReference)canReferenceLegacyEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getCanReferenceLegacy_MultipleReference() + { + return (EReference)canReferenceLegacyEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public EEnum getMyEnum() { return myEnumEEnum; @@ -1234,6 +1292,12 @@ public class Model6PackageImpl extends EPackageImpl implements Model6Package createEAttribute(unsettableAttributesEClass, UNSETTABLE_ATTRIBUTES__ATTR_SHORT_OBJECT); createEAttribute(unsettableAttributesEClass, UNSETTABLE_ATTRIBUTES__ATTR_STRING); + canReferenceLegacyEClass = createEClass(CAN_REFERENCE_LEGACY); + createEReference(canReferenceLegacyEClass, CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT); + createEReference(canReferenceLegacyEClass, CAN_REFERENCE_LEGACY__MULTIPLE_CONTAINMENT); + createEReference(canReferenceLegacyEClass, CAN_REFERENCE_LEGACY__SINGLE_REFERENCE); + createEReference(canReferenceLegacyEClass, CAN_REFERENCE_LEGACY__MULTIPLE_REFERENCE); + // Create enums myEnumEEnum = createEEnum(MY_ENUM); @@ -1525,6 +1589,21 @@ public class Model6PackageImpl extends EPackageImpl implements Model6Package UnsettableAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(canReferenceLegacyEClass, CanReferenceLegacy.class, "CanReferenceLegacy", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getCanReferenceLegacy_SingleContainment(), ecorePackage.getEObject(), null, "singleContainment", + null, 0, 1, CanReferenceLegacy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCanReferenceLegacy_MultipleContainment(), ecorePackage.getEObject(), null, "multipleContainment", + null, 0, -1, CanReferenceLegacy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCanReferenceLegacy_SingleReference(), ecorePackage.getEObject(), null, "singleReference", null, + 0, 1, CanReferenceLegacy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCanReferenceLegacy_MultipleReference(), ecorePackage.getEObject(), null, "multipleReference", + null, 0, -1, CanReferenceLegacy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + // Initialize enums and add enum literals initEEnum(myEnumEEnum, MyEnum.class, "MyEnum"); addEEnumLiteral(myEnumEEnum, MyEnum.ZERO); diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/Model6Factory.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/Model6Factory.java index b3e4a4609a..813856b41d 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/Model6Factory.java +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/Model6Factory.java @@ -6,6 +6,7 @@ import org.eclipse.emf.cdo.tests.model6.A; import org.eclipse.emf.cdo.tests.model6.B; import org.eclipse.emf.cdo.tests.model6.BaseObject; import org.eclipse.emf.cdo.tests.model6.C; +import org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy; import org.eclipse.emf.cdo.tests.model6.ContainmentObject; import org.eclipse.emf.cdo.tests.model6.D; import org.eclipse.emf.cdo.tests.model6.E; @@ -245,12 +246,21 @@ public interface Model6Factory extends EFactory, org.eclipse.emf.cdo.tests.model UnsettableAttributes createUnsettableAttributes(); /** - * Returns the package supported by this factory. + * Returns a new object of class '<em>Can Reference Legacy</em>'. * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the package supported by this factory. + * <!-- end-user-doc --> + * @return a new object of class '<em>Can Reference Legacy</em>'. * @generated */ + CanReferenceLegacy createCanReferenceLegacy(); + + /** + * Returns the package supported by this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the package supported by this factory. + * @generated + */ Model6Package getModel6Package(); } // Model6Factory diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/Model6Package.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/Model6Package.java index 1601102818..8dec284ff5 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/Model6Package.java +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/Model6Package.java @@ -1119,14 +1119,69 @@ public interface Model6Package extends EPackage, org.eclipse.emf.cdo.tests.model int UNSETTABLE_ATTRIBUTES_FEATURE_COUNT = 23; /** - * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model6.MyEnum <em>My Enum</em>}' enum. + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model6.legacy.impl.CanReferenceLegacyImpl <em>Can Reference Legacy</em>}' class. * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.emf.cdo.tests.model6.MyEnum - * @see org.eclipse.emf.cdo.tests.model6.legacy.impl.Model6PackageImpl#getMyEnum() + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.tests.model6.legacy.impl.CanReferenceLegacyImpl + * @see org.eclipse.emf.cdo.tests.model6.legacy.impl.Model6PackageImpl#getCanReferenceLegacy() * @generated */ - int MY_ENUM = 24; + int CAN_REFERENCE_LEGACY = 24; + + /** + * The feature id for the '<em><b>Single Containment</b></em>' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT = 0; + + /** + * The feature id for the '<em><b>Multiple Containment</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CAN_REFERENCE_LEGACY__MULTIPLE_CONTAINMENT = 1; + + /** + * The feature id for the '<em><b>Single Reference</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CAN_REFERENCE_LEGACY__SINGLE_REFERENCE = 2; + + /** + * The feature id for the '<em><b>Multiple Reference</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CAN_REFERENCE_LEGACY__MULTIPLE_REFERENCE = 3; + + /** + * The number of structural features of the '<em>Can Reference Legacy</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CAN_REFERENCE_LEGACY_FEATURE_COUNT = 4; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model6.MyEnum <em>My Enum</em>}' enum. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.cdo.tests.model6.MyEnum + * @see org.eclipse.emf.cdo.tests.model6.legacy.impl.Model6PackageImpl#getMyEnum() + * @generated + */ + int MY_ENUM = 25; /** * The meta object id for the '<em>My String</em>' data type. @@ -1136,7 +1191,7 @@ public interface Model6Package extends EPackage, org.eclipse.emf.cdo.tests.model * @see org.eclipse.emf.cdo.tests.model6.legacy.impl.Model6PackageImpl#getMyString() * @generated */ - int MY_STRING = 25; + int MY_STRING = 26; /** * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model6.Root <em>Root</em>}'. @@ -2030,13 +2085,67 @@ public interface Model6Package extends EPackage, org.eclipse.emf.cdo.tests.model EAttribute getUnsettableAttributes_AttrString(); /** - * Returns the meta object for enum '{@link org.eclipse.emf.cdo.tests.model6.MyEnum <em>My Enum</em>}'. + * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy <em>Can Reference Legacy</em>}'. * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for enum '<em>My Enum</em>'. - * @see org.eclipse.emf.cdo.tests.model6.MyEnum + * <!-- end-user-doc --> + * @return the meta object for class '<em>Can Reference Legacy</em>'. + * @see org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy * @generated */ + EClass getCanReferenceLegacy(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getSingleContainment <em>Single Containment</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference '<em>Single Containment</em>'. + * @see org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getSingleContainment() + * @see #getCanReferenceLegacy() + * @generated + */ + EReference getCanReferenceLegacy_SingleContainment(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getMultipleContainment <em>Multiple Containment</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Multiple Containment</em>'. + * @see org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getMultipleContainment() + * @see #getCanReferenceLegacy() + * @generated + */ + EReference getCanReferenceLegacy_MultipleContainment(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getSingleReference <em>Single Reference</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Single Reference</em>'. + * @see org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getSingleReference() + * @see #getCanReferenceLegacy() + * @generated + */ + EReference getCanReferenceLegacy_SingleReference(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getMultipleReference <em>Multiple Reference</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Multiple Reference</em>'. + * @see org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy#getMultipleReference() + * @see #getCanReferenceLegacy() + * @generated + */ + EReference getCanReferenceLegacy_MultipleReference(); + + /** + * Returns the meta object for enum '{@link org.eclipse.emf.cdo.tests.model6.MyEnum <em>My Enum</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for enum '<em>My Enum</em>'. + * @see org.eclipse.emf.cdo.tests.model6.MyEnum + * @generated + */ EEnum getMyEnum(); /** diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/impl/CanReferenceLegacyImpl.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/impl/CanReferenceLegacyImpl.java new file mode 100644 index 0000000000..5433bfa849 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/impl/CanReferenceLegacyImpl.java @@ -0,0 +1,397 @@ +/* + * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus (CEA) - initial API and implementation + */ +package org.eclipse.emf.cdo.tests.model6.legacy.impl; + +import java.util.Collection; + +import org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy; + +import org.eclipse.emf.cdo.tests.model6.legacy.Model6Package; + +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.EObject; +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.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Can Reference Legacy</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.cdo.tests.model6.legacy.impl.CanReferenceLegacyImpl#getSingleContainment <em>Single Containment</em>}</li> + * <li>{@link org.eclipse.emf.cdo.tests.model6.legacy.impl.CanReferenceLegacyImpl#getMultipleContainment <em>Multiple Containment</em>}</li> + * <li>{@link org.eclipse.emf.cdo.tests.model6.legacy.impl.CanReferenceLegacyImpl#getSingleReference <em>Single Reference</em>}</li> + * <li>{@link org.eclipse.emf.cdo.tests.model6.legacy.impl.CanReferenceLegacyImpl#getMultipleReference <em>Multiple Reference</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class CanReferenceLegacyImpl extends EObjectImpl implements CanReferenceLegacy +{ + /** + * The cached value of the '{@link #getSingleContainment() <em>Single Containment</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSingleContainment() + * @generated + * @ordered + */ + protected EObject singleContainment; + + /** + * The cached value of the '{@link #getMultipleContainment() <em>Multiple Containment</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMultipleContainment() + * @generated + * @ordered + */ + protected EList<EObject> multipleContainment; + + /** + * The cached value of the '{@link #getSingleReference() <em>Single Reference</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSingleReference() + * @generated + * @ordered + */ + protected EObject singleReference; + + /** + * The cached value of the '{@link #getMultipleReference() <em>Multiple Reference</em>}' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMultipleReference() + * @generated + * @ordered + */ + protected EList<EObject> multipleReference; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected CanReferenceLegacyImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return Model6Package.eINSTANCE.getCanReferenceLegacy(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EObject getSingleContainment() + { + if (singleContainment != null && singleContainment.eIsProxy()) + { + InternalEObject oldSingleContainment = (InternalEObject)singleContainment; + singleContainment = eResolveProxy(oldSingleContainment); + if (singleContainment != oldSingleContainment) + { + InternalEObject newSingleContainment = (InternalEObject)singleContainment; + NotificationChain msgs = oldSingleContainment.eInverseRemove(this, EOPPOSITE_FEATURE_BASE + - Model6Package.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT, null, null); + if (newSingleContainment.eInternalContainer() == null) + { + msgs = newSingleContainment.eInverseAdd(this, EOPPOSITE_FEATURE_BASE + - Model6Package.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT, null, msgs); + } + if (msgs != null) + msgs.dispatch(); + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Model6Package.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT, oldSingleContainment, singleContainment)); + } + } + return singleContainment; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EObject basicGetSingleContainment() + { + return singleContainment; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetSingleContainment(EObject newSingleContainment, NotificationChain msgs) + { + EObject oldSingleContainment = singleContainment; + singleContainment = newSingleContainment; + if (eNotificationRequired()) + { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + Model6Package.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT, oldSingleContainment, newSingleContainment); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setSingleContainment(EObject newSingleContainment) + { + if (newSingleContainment != singleContainment) + { + NotificationChain msgs = null; + if (singleContainment != null) + msgs = ((InternalEObject)singleContainment).eInverseRemove(this, EOPPOSITE_FEATURE_BASE + - Model6Package.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT, null, msgs); + if (newSingleContainment != null) + msgs = ((InternalEObject)newSingleContainment).eInverseAdd(this, EOPPOSITE_FEATURE_BASE + - Model6Package.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT, null, msgs); + msgs = basicSetSingleContainment(newSingleContainment, msgs); + if (msgs != null) + msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model6Package.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT, + newSingleContainment, newSingleContainment)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<EObject> getMultipleContainment() + { + if (multipleContainment == null) + { + multipleContainment = new EObjectContainmentEList.Resolving<EObject>(EObject.class, this, + Model6Package.CAN_REFERENCE_LEGACY__MULTIPLE_CONTAINMENT); + } + return multipleContainment; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EObject getSingleReference() + { + if (singleReference != null && singleReference.eIsProxy()) + { + InternalEObject oldSingleReference = (InternalEObject)singleReference; + singleReference = eResolveProxy(oldSingleReference); + if (singleReference != oldSingleReference) + { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + Model6Package.CAN_REFERENCE_LEGACY__SINGLE_REFERENCE, oldSingleReference, singleReference)); + } + } + return singleReference; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EObject basicGetSingleReference() + { + return singleReference; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setSingleReference(EObject newSingleReference) + { + EObject oldSingleReference = singleReference; + singleReference = newSingleReference; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Model6Package.CAN_REFERENCE_LEGACY__SINGLE_REFERENCE, + oldSingleReference, singleReference)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<EObject> getMultipleReference() + { + if (multipleReference == null) + { + multipleReference = new EObjectResolvingEList<EObject>(EObject.class, this, + Model6Package.CAN_REFERENCE_LEGACY__MULTIPLE_REFERENCE); + } + return multipleReference; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case Model6Package.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT: + return basicSetSingleContainment(null, msgs); + case Model6Package.CAN_REFERENCE_LEGACY__MULTIPLE_CONTAINMENT: + return ((InternalEList<?>)getMultipleContainment()).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 Model6Package.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT: + if (resolve) + return getSingleContainment(); + return basicGetSingleContainment(); + case Model6Package.CAN_REFERENCE_LEGACY__MULTIPLE_CONTAINMENT: + return getMultipleContainment(); + case Model6Package.CAN_REFERENCE_LEGACY__SINGLE_REFERENCE: + if (resolve) + return getSingleReference(); + return basicGetSingleReference(); + case Model6Package.CAN_REFERENCE_LEGACY__MULTIPLE_REFERENCE: + return getMultipleReference(); + } + 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 Model6Package.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT: + setSingleContainment((EObject)newValue); + return; + case Model6Package.CAN_REFERENCE_LEGACY__MULTIPLE_CONTAINMENT: + getMultipleContainment().clear(); + getMultipleContainment().addAll((Collection<? extends EObject>)newValue); + return; + case Model6Package.CAN_REFERENCE_LEGACY__SINGLE_REFERENCE: + setSingleReference((EObject)newValue); + return; + case Model6Package.CAN_REFERENCE_LEGACY__MULTIPLE_REFERENCE: + getMultipleReference().clear(); + getMultipleReference().addAll((Collection<? extends EObject>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case Model6Package.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT: + setSingleContainment((EObject)null); + return; + case Model6Package.CAN_REFERENCE_LEGACY__MULTIPLE_CONTAINMENT: + getMultipleContainment().clear(); + return; + case Model6Package.CAN_REFERENCE_LEGACY__SINGLE_REFERENCE: + setSingleReference((EObject)null); + return; + case Model6Package.CAN_REFERENCE_LEGACY__MULTIPLE_REFERENCE: + getMultipleReference().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case Model6Package.CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT: + return singleContainment != null; + case Model6Package.CAN_REFERENCE_LEGACY__MULTIPLE_CONTAINMENT: + return multipleContainment != null && !multipleContainment.isEmpty(); + case Model6Package.CAN_REFERENCE_LEGACY__SINGLE_REFERENCE: + return singleReference != null; + case Model6Package.CAN_REFERENCE_LEGACY__MULTIPLE_REFERENCE: + return multipleReference != null && !multipleReference.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //CanReferenceLegacyImpl diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/impl/Model6FactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/impl/Model6FactoryImpl.java index 0765ef2b31..a14297bba2 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/impl/Model6FactoryImpl.java +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/impl/Model6FactoryImpl.java @@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.tests.model6.A; import org.eclipse.emf.cdo.tests.model6.B; import org.eclipse.emf.cdo.tests.model6.BaseObject; import org.eclipse.emf.cdo.tests.model6.C; +import org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy; import org.eclipse.emf.cdo.tests.model6.ContainmentObject; import org.eclipse.emf.cdo.tests.model6.D; import org.eclipse.emf.cdo.tests.model6.E; @@ -141,6 +142,8 @@ public class Model6FactoryImpl extends EFactoryImpl implements Model6Factory return createEmptyStringDefaultUnsettable(); case Model6Package.UNSETTABLE_ATTRIBUTES: return createUnsettableAttributes(); + case Model6Package.CAN_REFERENCE_LEGACY: + return createCanReferenceLegacy(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -428,9 +431,20 @@ public class Model6FactoryImpl extends EFactoryImpl implements Model6Factory /** * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- end-user-doc --> * @generated */ + public CanReferenceLegacy createCanReferenceLegacy() + { + CanReferenceLegacyImpl canReferenceLegacy = new CanReferenceLegacyImpl(); + return canReferenceLegacy; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public MyEnum createMyEnumFromString(EDataType eDataType, String initialValue) { MyEnum result = MyEnum.get(initialValue); diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/impl/Model6PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/impl/Model6PackageImpl.java index f269d36cab..b37466fb2d 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/impl/Model6PackageImpl.java +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/impl/Model6PackageImpl.java @@ -11,6 +11,7 @@ package org.eclipse.emf.cdo.tests.model6.legacy.impl; import org.eclipse.emf.cdo.tests.model6.BaseObject; +import org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy; import org.eclipse.emf.cdo.tests.model6.ContainmentObject; import org.eclipse.emf.cdo.tests.model6.EmptyStringDefault; import org.eclipse.emf.cdo.tests.model6.EmptyStringDefaultUnsettable; @@ -206,9 +207,16 @@ public class Model6PackageImpl extends EPackageImpl implements Model6Package /** * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- end-user-doc --> * @generated */ + private EClass canReferenceLegacyEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ private EEnum myEnumEEnum = null; /** @@ -1081,9 +1089,59 @@ public class Model6PackageImpl extends EPackageImpl implements Model6Package /** * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- end-user-doc --> * @generated */ + public EClass getCanReferenceLegacy() + { + return canReferenceLegacyEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getCanReferenceLegacy_SingleContainment() + { + return (EReference)canReferenceLegacyEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getCanReferenceLegacy_MultipleContainment() + { + return (EReference)canReferenceLegacyEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getCanReferenceLegacy_SingleReference() + { + return (EReference)canReferenceLegacyEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getCanReferenceLegacy_MultipleReference() + { + return (EReference)canReferenceLegacyEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public EEnum getMyEnum() { return myEnumEEnum; @@ -1234,6 +1292,12 @@ public class Model6PackageImpl extends EPackageImpl implements Model6Package createEAttribute(unsettableAttributesEClass, UNSETTABLE_ATTRIBUTES__ATTR_SHORT_OBJECT); createEAttribute(unsettableAttributesEClass, UNSETTABLE_ATTRIBUTES__ATTR_STRING); + canReferenceLegacyEClass = createEClass(CAN_REFERENCE_LEGACY); + createEReference(canReferenceLegacyEClass, CAN_REFERENCE_LEGACY__SINGLE_CONTAINMENT); + createEReference(canReferenceLegacyEClass, CAN_REFERENCE_LEGACY__MULTIPLE_CONTAINMENT); + createEReference(canReferenceLegacyEClass, CAN_REFERENCE_LEGACY__SINGLE_REFERENCE); + createEReference(canReferenceLegacyEClass, CAN_REFERENCE_LEGACY__MULTIPLE_REFERENCE); + // Create enums myEnumEEnum = createEEnum(MY_ENUM); @@ -1525,6 +1589,21 @@ public class Model6PackageImpl extends EPackageImpl implements Model6Package UnsettableAttributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(canReferenceLegacyEClass, CanReferenceLegacy.class, "CanReferenceLegacy", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getCanReferenceLegacy_SingleContainment(), ecorePackage.getEObject(), null, "singleContainment", + null, 0, 1, CanReferenceLegacy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCanReferenceLegacy_MultipleContainment(), ecorePackage.getEObject(), null, "multipleContainment", + null, 0, -1, CanReferenceLegacy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCanReferenceLegacy_SingleReference(), ecorePackage.getEObject(), null, "singleReference", null, + 0, 1, CanReferenceLegacy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCanReferenceLegacy_MultipleReference(), ecorePackage.getEObject(), null, "multipleReference", + null, 0, -1, CanReferenceLegacy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + // Initialize enums and add enum literals initEEnum(myEnumEEnum, MyEnum.class, "MyEnum"); addEEnumLiteral(myEnumEEnum, MyEnum.ZERO); diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/util/Model6AdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/util/Model6AdapterFactory.java index 392111510a..c0ac470f60 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/util/Model6AdapterFactory.java +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/util/Model6AdapterFactory.java @@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.tests.model6.A; import org.eclipse.emf.cdo.tests.model6.B; import org.eclipse.emf.cdo.tests.model6.BaseObject; import org.eclipse.emf.cdo.tests.model6.C; +import org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy; import org.eclipse.emf.cdo.tests.model6.ContainmentObject; import org.eclipse.emf.cdo.tests.model6.D; import org.eclipse.emf.cdo.tests.model6.E; @@ -251,6 +252,12 @@ public class Model6AdapterFactory extends AdapterFactoryImpl } @Override + public Adapter caseCanReferenceLegacy(CanReferenceLegacy object) + { + return createCanReferenceLegacyAdapter(); + } + + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); @@ -632,13 +639,28 @@ public class Model6AdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for the default case. + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy <em>Can Reference Legacy</em>}'. * <!-- begin-user-doc --> - * This default implementation returns null. - * <!-- end-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> * @return the new adapter. + * @see org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy * @generated */ + public Adapter createCanReferenceLegacyAdapter() + { + return null; + } + + /** + * Creates a new adapter for the default case. + * <!-- begin-user-doc --> + * This default implementation returns null. + * <!-- end-user-doc --> + * @return the new adapter. + * @generated + */ public Adapter createEObjectAdapter() { return null; diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/util/Model6Switch.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/util/Model6Switch.java index 1540b94b12..0cce5cda31 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/util/Model6Switch.java +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/legacy/util/Model6Switch.java @@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.tests.model6.A; import org.eclipse.emf.cdo.tests.model6.B; import org.eclipse.emf.cdo.tests.model6.BaseObject; import org.eclipse.emf.cdo.tests.model6.C; +import org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy; import org.eclipse.emf.cdo.tests.model6.ContainmentObject; import org.eclipse.emf.cdo.tests.model6.D; import org.eclipse.emf.cdo.tests.model6.E; @@ -324,6 +325,14 @@ public class Model6Switch<T> result = defaultCase(theEObject); return result; } + case Model6Package.CAN_REFERENCE_LEGACY: + { + CanReferenceLegacy canReferenceLegacy = (CanReferenceLegacy)theEObject; + T result = caseCanReferenceLegacy(canReferenceLegacy); + if (result == null) + result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } @@ -714,16 +723,32 @@ public class Model6Switch<T> } /** - * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. + * Returns the result of interpreting the object as an instance of '<em>Can Reference Legacy</em>'. * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * <!-- end-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> * @param object the target of the switch. - * @return the result of interpreting the object as an instance of '<em>EObject</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @return the result of interpreting the object as an instance of '<em>Can Reference Legacy</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ + public T caseCanReferenceLegacy(CanReferenceLegacy object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>EObject</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ public T defaultCase(EObject object) { return null; diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/util/Model6AdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/util/Model6AdapterFactory.java index 587b348c40..4d8f52492c 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/util/Model6AdapterFactory.java +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/util/Model6AdapterFactory.java @@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.tests.model6.A; import org.eclipse.emf.cdo.tests.model6.B; import org.eclipse.emf.cdo.tests.model6.BaseObject; import org.eclipse.emf.cdo.tests.model6.C; +import org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy; import org.eclipse.emf.cdo.tests.model6.ContainmentObject; import org.eclipse.emf.cdo.tests.model6.D; import org.eclipse.emf.cdo.tests.model6.E; @@ -246,6 +247,12 @@ public class Model6AdapterFactory extends AdapterFactoryImpl } @Override + public Adapter caseCanReferenceLegacy(CanReferenceLegacy object) + { + return createCanReferenceLegacyAdapter(); + } + + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); @@ -612,12 +619,27 @@ public class Model6AdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for the default case. - * <!-- begin-user-doc --> This default implementation returns null. <!-- - * end-user-doc --> + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy <em>Can Reference Legacy</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> * @return the new adapter. + * @see org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy * @generated */ + public Adapter createCanReferenceLegacyAdapter() + { + return null; + } + + /** + * Creates a new adapter for the default case. + * <!-- begin-user-doc --> This default implementation returns null. <!-- + * end-user-doc --> + * @return the new adapter. + * @generated + */ public Adapter createEObjectAdapter() { return null; diff --git a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/util/Model6Switch.java b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/util/Model6Switch.java index c7d6886c5e..abcf0c8969 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/util/Model6Switch.java +++ b/plugins/org.eclipse.emf.cdo.tests.model6/src/org/eclipse/emf/cdo/tests/model6/util/Model6Switch.java @@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.tests.model6.A; import org.eclipse.emf.cdo.tests.model6.B; import org.eclipse.emf.cdo.tests.model6.BaseObject; import org.eclipse.emf.cdo.tests.model6.C; +import org.eclipse.emf.cdo.tests.model6.CanReferenceLegacy; import org.eclipse.emf.cdo.tests.model6.ContainmentObject; import org.eclipse.emf.cdo.tests.model6.D; import org.eclipse.emf.cdo.tests.model6.E; @@ -314,6 +315,14 @@ public class Model6Switch<T> result = defaultCase(theEObject); return result; } + case Model6Package.CAN_REFERENCE_LEGACY: + { + CanReferenceLegacy canReferenceLegacy = (CanReferenceLegacy)theEObject; + T result = caseCanReferenceLegacy(canReferenceLegacy); + if (result == null) + result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } @@ -682,15 +691,31 @@ public class Model6Switch<T> } /** - * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. - * <!-- begin-user-doc --> This - * implementation returns null; returning a non-null result will terminate the switch, but this is the last case - * anyway. <!-- end-user-doc --> + * Returns the result of interpreting the object as an instance of '<em>Can Reference Legacy</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> * @param object the target of the switch. - * @return the result of interpreting the object as an instance of '<em>EObject</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @return the result of interpreting the object as an instance of '<em>Can Reference Legacy</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ + public T caseCanReferenceLegacy(CanReferenceLegacy object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. + * <!-- begin-user-doc --> This + * implementation returns null; returning a non-null result will terminate the switch, but this is the last case + * anyway. <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>EObject</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ public T defaultCase(EObject object) { return null; |