diff options
author | Martin Taal | 2011-12-05 20:43:41 +0000 |
---|---|---|
committer | Martin Taal | 2011-12-05 20:43:41 +0000 |
commit | 3f4b1cf30440b375770f5e66d2a690a92bebb186 (patch) | |
tree | 556750925e3e9b61323041bc26bac41937df90dc /tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf | |
parent | 3c72cc9219423c643a7b04fb11e3d9c7d53abccd (diff) | |
download | org.eclipse.emf.teneo-3f4b1cf30440b375770f5e66d2a690a92bebb186.tar.gz org.eclipse.emf.teneo-3f4b1cf30440b375770f5e66d2a690a92bebb186.tar.xz org.eclipse.emf.teneo-3f4b1cf30440b375770f5e66d2a690a92bebb186.zip |
Fixes issue [359802] - Uniqueness validation for constraints when using mappedsuperclass
Diffstat (limited to 'tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf')
14 files changed, 605 insertions, 43 deletions
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/Document.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/Document.java index eca1fc95e..e8a4a179c 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/Document.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/Document.java @@ -17,6 +17,7 @@ import org.eclipse.emf.ecore.EObject; * The following features are supported: * <ul> * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.Document#getMyGenericInfo <em>My Generic Info</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.Document#getMyTestReference <em>My Test Reference</em>}</li> * </ul> * </p> * @@ -53,4 +54,31 @@ public interface Document extends EObject { */ void setMyGenericInfo(String value); + /** + * Returns the value of the '<em><b>My Test Reference</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>My Test 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>My Test Reference</em>' reference. + * @see #setMyTestReference(TestReference) + * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.MappedsuperclassPackage#getDocument_MyTestReference() + * @model resolveProxies="false" required="true" + * extendedMetaData="kind='element' name='myTestReference'" + * @generated + */ + TestReference getMyTestReference(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.Document#getMyTestReference <em>My Test Reference</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>My Test Reference</em>' reference. + * @see #getMyTestReference() + * @generated + */ + void setMyTestReference(TestReference value); + } // Document diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/MappedsuperclassFactory.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/MappedsuperclassFactory.java index 8fbaabbe7..7b0d0dab0 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/MappedsuperclassFactory.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/MappedsuperclassFactory.java @@ -62,6 +62,15 @@ public interface MappedsuperclassFactory extends EFactory { SpecificDocument createSpecificDocument(); /** + * Returns a new object of class '<em>Test Reference</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Test Reference</em>'. + * @generated + */ + TestReference createTestReference(); + + /** * Returns the package supported by this factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/MappedsuperclassPackage.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/MappedsuperclassPackage.java index ffe0feb47..5fe7a2fe9 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/MappedsuperclassPackage.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/MappedsuperclassPackage.java @@ -9,6 +9,7 @@ package org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; /** * <!-- begin-user-doc --> @@ -78,13 +79,22 @@ public interface MappedsuperclassPackage extends EPackage { int DOCUMENT__MY_GENERIC_INFO = 0; /** + * The feature id for the '<em><b>My Test Reference</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int DOCUMENT__MY_TEST_REFERENCE = 1; + + /** * The number of structural features of the '<em>Document</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int DOCUMENT_FEATURE_COUNT = 1; + int DOCUMENT_FEATURE_COUNT = 2; /** * The meta object id for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.impl.AddIDDocumentImpl <em>Add ID Document</em>}' class. @@ -106,6 +116,15 @@ public interface MappedsuperclassPackage extends EPackage { int ADD_ID_DOCUMENT__MY_GENERIC_INFO = DOCUMENT__MY_GENERIC_INFO; /** + * The feature id for the '<em><b>My Test Reference</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ADD_ID_DOCUMENT__MY_TEST_REFERENCE = DOCUMENT__MY_TEST_REFERENCE; + + /** * The feature id for the '<em><b>Name</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -143,6 +162,15 @@ public interface MappedsuperclassPackage extends EPackage { int PARENT_DOCUMENT__MY_GENERIC_INFO = DOCUMENT__MY_GENERIC_INFO; /** + * The feature id for the '<em><b>My Test Reference</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PARENT_DOCUMENT__MY_TEST_REFERENCE = DOCUMENT__MY_TEST_REFERENCE; + + /** * The feature id for the '<em><b>My Name</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -180,6 +208,15 @@ public interface MappedsuperclassPackage extends EPackage { int SPECIFIC_DOCUMENT__MY_GENERIC_INFO = PARENT_DOCUMENT__MY_GENERIC_INFO; /** + * The feature id for the '<em><b>My Test Reference</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int SPECIFIC_DOCUMENT__MY_TEST_REFERENCE = PARENT_DOCUMENT__MY_TEST_REFERENCE; + + /** * The feature id for the '<em><b>My Name</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -208,6 +245,35 @@ public interface MappedsuperclassPackage extends EPackage { /** + * The meta object id for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.impl.TestReferenceImpl <em>Test Reference</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.impl.TestReferenceImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.impl.MappedsuperclassPackageImpl#getTestReference() + * @generated + */ + int TEST_REFERENCE = 4; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int TEST_REFERENCE__NAME = 0; + + /** + * The number of structural features of the '<em>Test Reference</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int TEST_REFERENCE_FEATURE_COUNT = 1; + + + /** * Returns the meta object for class '{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.AddIDDocument <em>Add ID Document</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -250,6 +316,17 @@ public interface MappedsuperclassPackage extends EPackage { EAttribute getDocument_MyGenericInfo(); /** + * Returns the meta object for the reference '{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.Document#getMyTestReference <em>My Test Reference</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>My Test Reference</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.Document#getMyTestReference() + * @see #getDocument() + * @generated + */ + EReference getDocument_MyTestReference(); + + /** * Returns the meta object for class '{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.ParentDocument <em>Parent Document</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -292,6 +369,27 @@ public interface MappedsuperclassPackage extends EPackage { EAttribute getSpecificDocument_MySpecificInfo(); /** + * Returns the meta object for class '{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.TestReference <em>Test Reference</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Test Reference</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.TestReference + * @generated + */ + EClass getTestReference(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.TestReference#getName <em>Name</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Name</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.TestReference#getName() + * @see #getTestReference() + * @generated + */ + EAttribute getTestReference_Name(); + + /** * Returns the factory that creates the instances of the model. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -350,6 +448,14 @@ public interface MappedsuperclassPackage extends EPackage { EAttribute DOCUMENT__MY_GENERIC_INFO = eINSTANCE.getDocument_MyGenericInfo(); /** + * The meta object literal for the '<em><b>My Test Reference</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference DOCUMENT__MY_TEST_REFERENCE = eINSTANCE.getDocument_MyTestReference(); + + /** * The meta object literal for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.impl.ParentDocumentImpl <em>Parent Document</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -385,6 +491,24 @@ public interface MappedsuperclassPackage extends EPackage { */ EAttribute SPECIFIC_DOCUMENT__MY_SPECIFIC_INFO = eINSTANCE.getSpecificDocument_MySpecificInfo(); + /** + * The meta object literal for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.impl.TestReferenceImpl <em>Test Reference</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.impl.TestReferenceImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.impl.MappedsuperclassPackageImpl#getTestReference() + * @generated + */ + EClass TEST_REFERENCE = eINSTANCE.getTestReference(); + + /** + * The meta object literal for the '<em><b>Name</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute TEST_REFERENCE__NAME = eINSTANCE.getTestReference_Name(); + } } //MappedsuperclassPackage diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/TestReference.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/TestReference.java new file mode 100644 index 000000000..3d8895fbd --- /dev/null +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/TestReference.java @@ -0,0 +1,56 @@ +/** + * <copyright> + * </copyright> + * + * $Id$ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Test Reference</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.TestReference#getName <em>Name</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.MappedsuperclassPackage#getTestReference() + * @model annotation="teneo.jpa appinfo='@Entity'" + * extendedMetaData="name='TestReference' kind='elementOnly'" + * @generated + */ +public interface TestReference extends EObject { + + /** + * Returns the value of the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Name</em>' attribute. + * @see #setName(String) + * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.MappedsuperclassPackage#getTestReference_Name() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true" + * extendedMetaData="kind='element' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.TestReference#getName <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Name</em>' attribute. + * @see #getName() + * @generated + */ + void setName(String value); +} // TestReference diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/DocumentImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/DocumentImpl.java index 3cebaddb6..edd74fd3d 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/DocumentImpl.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/DocumentImpl.java @@ -15,6 +15,7 @@ import org.eclipse.emf.ecore.impl.EObjectImpl; import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.Document; import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.MappedsuperclassPackage; +import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.TestReference; /** * <!-- begin-user-doc --> @@ -24,6 +25,7 @@ import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.Mappedsupe * The following features are implemented: * <ul> * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.impl.DocumentImpl#getMyGenericInfo <em>My Generic Info</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.impl.DocumentImpl#getMyTestReference <em>My Test Reference</em>}</li> * </ul> * </p> * @@ -51,6 +53,16 @@ public class DocumentImpl extends EObjectImpl implements Document { protected String myGenericInfo = MY_GENERIC_INFO_EDEFAULT; /** + * The cached value of the '{@link #getMyTestReference() <em>My Test Reference</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMyTestReference() + * @generated + * @ordered + */ + protected TestReference myTestReference; + + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -95,11 +107,34 @@ public class DocumentImpl extends EObjectImpl implements Document { * <!-- end-user-doc --> * @generated */ + public TestReference getMyTestReference() { + return myTestReference; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setMyTestReference(TestReference newMyTestReference) { + TestReference oldMyTestReference = myTestReference; + myTestReference = newMyTestReference; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, MappedsuperclassPackage.DOCUMENT__MY_TEST_REFERENCE, oldMyTestReference, myTestReference)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case MappedsuperclassPackage.DOCUMENT__MY_GENERIC_INFO: return getMyGenericInfo(); + case MappedsuperclassPackage.DOCUMENT__MY_TEST_REFERENCE: + return getMyTestReference(); } return super.eGet(featureID, resolve, coreType); } @@ -115,6 +150,9 @@ public class DocumentImpl extends EObjectImpl implements Document { case MappedsuperclassPackage.DOCUMENT__MY_GENERIC_INFO: setMyGenericInfo((String)newValue); return; + case MappedsuperclassPackage.DOCUMENT__MY_TEST_REFERENCE: + setMyTestReference((TestReference)newValue); + return; } super.eSet(featureID, newValue); } @@ -130,6 +168,9 @@ public class DocumentImpl extends EObjectImpl implements Document { case MappedsuperclassPackage.DOCUMENT__MY_GENERIC_INFO: setMyGenericInfo(MY_GENERIC_INFO_EDEFAULT); return; + case MappedsuperclassPackage.DOCUMENT__MY_TEST_REFERENCE: + setMyTestReference((TestReference)null); + return; } super.eUnset(featureID); } @@ -144,6 +185,8 @@ public class DocumentImpl extends EObjectImpl implements Document { switch (featureID) { case MappedsuperclassPackage.DOCUMENT__MY_GENERIC_INFO: return MY_GENERIC_INFO_EDEFAULT == null ? myGenericInfo != null : !MY_GENERIC_INFO_EDEFAULT.equals(myGenericInfo); + case MappedsuperclassPackage.DOCUMENT__MY_TEST_REFERENCE: + return myTestReference != null; } return super.eIsSet(featureID); } diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/MappedsuperclassFactoryImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/MappedsuperclassFactoryImpl.java index 1c82be06e..d9ec087e9 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/MappedsuperclassFactoryImpl.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/MappedsuperclassFactoryImpl.java @@ -64,6 +64,7 @@ public class MappedsuperclassFactoryImpl extends EFactoryImpl implements Mappeds case MappedsuperclassPackage.DOCUMENT: return createDocument(); case MappedsuperclassPackage.PARENT_DOCUMENT: return createParentDocument(); case MappedsuperclassPackage.SPECIFIC_DOCUMENT: return createSpecificDocument(); + case MappedsuperclassPackage.TEST_REFERENCE: return createTestReference(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -114,6 +115,16 @@ public class MappedsuperclassFactoryImpl extends EFactoryImpl implements Mappeds * <!-- end-user-doc --> * @generated */ + public TestReference createTestReference() { + TestReferenceImpl testReference = new TestReferenceImpl(); + return testReference; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public MappedsuperclassPackage getMappedsuperclassPackage() { return (MappedsuperclassPackage)getEPackage(); } diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/MappedsuperclassPackageImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/MappedsuperclassPackageImpl.java index 1f8fb7d06..51b114bd5 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/MappedsuperclassPackageImpl.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/MappedsuperclassPackageImpl.java @@ -10,6 +10,7 @@ import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.impl.EPackageImpl; import org.eclipse.emf.ecore.xml.type.XMLTypePackage; @@ -20,6 +21,7 @@ import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.Mappedsupe import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.MappedsuperclassPackage; import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.ParentDocument; import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.SpecificDocument; +import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.TestReference; /** * <!-- begin-user-doc --> @@ -57,6 +59,13 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds private EClass specificDocumentEClass = null; /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass testReferenceEClass = null; + + /** * Creates an instance of the model <b>Package</b>, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package * package URI value. @@ -83,20 +92,10 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds private static boolean isInited = false; /** - * Creates, registers, and initializes the <b>Package</b> for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - * <p>Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - * <p>Invocation of this method will not affect any packages that have - * already been initialized. + * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. + * + * <p>This method is used to initialize {@link MappedsuperclassPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #eNS_URI @@ -108,7 +107,7 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds if (isInited) return (MappedsuperclassPackage)EPackage.Registry.INSTANCE.getEPackage(MappedsuperclassPackage.eNS_URI); // Obtain or create and register package - MappedsuperclassPackageImpl theMappedsuperclassPackage = (MappedsuperclassPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof MappedsuperclassPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new MappedsuperclassPackageImpl()); + MappedsuperclassPackageImpl theMappedsuperclassPackage = (MappedsuperclassPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof MappedsuperclassPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new MappedsuperclassPackageImpl()); isInited = true; @@ -124,6 +123,9 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds // Mark meta-data to indicate it can't be changed theMappedsuperclassPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(MappedsuperclassPackage.eNS_URI, theMappedsuperclassPackage); return theMappedsuperclassPackage; } @@ -168,6 +170,15 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds * <!-- end-user-doc --> * @generated */ + public EReference getDocument_MyTestReference() { + return (EReference)documentEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public EClass getParentDocument() { return parentDocumentEClass; } @@ -204,6 +215,24 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds * <!-- end-user-doc --> * @generated */ + public EClass getTestReference() { + return testReferenceEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getTestReference_Name() { + return (EAttribute)testReferenceEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public MappedsuperclassFactory getMappedsuperclassFactory() { return (MappedsuperclassFactory)getEFactoryInstance(); } @@ -232,12 +261,16 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds documentEClass = createEClass(DOCUMENT); createEAttribute(documentEClass, DOCUMENT__MY_GENERIC_INFO); + createEReference(documentEClass, DOCUMENT__MY_TEST_REFERENCE); parentDocumentEClass = createEClass(PARENT_DOCUMENT); createEAttribute(parentDocumentEClass, PARENT_DOCUMENT__MY_NAME); specificDocumentEClass = createEClass(SPECIFIC_DOCUMENT); createEAttribute(specificDocumentEClass, SPECIFIC_DOCUMENT__MY_SPECIFIC_INFO); + + testReferenceEClass = createEClass(TEST_REFERENCE); + createEAttribute(testReferenceEClass, TEST_REFERENCE__NAME); } /** @@ -281,6 +314,7 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds initEClass(documentEClass, Document.class, "Document", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getDocument_MyGenericInfo(), theXMLTypePackage.getString(), "myGenericInfo", null, 1, 1, Document.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocument_MyTestReference(), this.getTestReference(), null, "myTestReference", null, 1, 1, Document.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(parentDocumentEClass, ParentDocument.class, "ParentDocument", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getParentDocument_MyName(), theXMLTypePackage.getString(), "myName", null, 1, 1, ParentDocument.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -288,6 +322,9 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds initEClass(specificDocumentEClass, SpecificDocument.class, "SpecificDocument", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getSpecificDocument_MySpecificInfo(), theXMLTypePackage.getString(), "mySpecificInfo", null, 1, 1, SpecificDocument.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(testReferenceEClass, TestReference.class, "TestReference", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getTestReference_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, TestReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + // Create resource createResource(eNS_URI); @@ -317,7 +354,7 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds source, new String[] { "appinfo", "@MappedSuperclass" - }); + }); addAnnotation (parentDocumentEClass, source, @@ -335,6 +372,12 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds source, new String[] { "appinfo", "@Entity\n @AttributeOverrides({@AttributeOverride(name=\"myName\", \n\t\tcolumn=@Column(name=\"PARENTDOCUMENT_NAME\", length=\"50\"))})\n\t\t\t" + }); + addAnnotation + (testReferenceEClass, + source, + new String[] { + "appinfo", "@Entity" }); } @@ -373,6 +416,13 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds new String[] { "kind", "element", "name", "myGenericInfo" + }); + addAnnotation + (getDocument_MyTestReference(), + source, + new String[] { + "kind", "element", + "name", "myTestReference" }); addAnnotation (parentDocumentEClass, @@ -401,6 +451,20 @@ public class MappedsuperclassPackageImpl extends EPackageImpl implements Mappeds new String[] { "kind", "element", "name", "mySpecificInfo" + }); + addAnnotation + (testReferenceEClass, + source, + new String[] { + "name", "TestReference", + "kind", "elementOnly" + }); + addAnnotation + (getTestReference_Name(), + source, + new String[] { + "kind", "element", + "name", "name" }); } diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/ParentDocumentImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/ParentDocumentImpl.java index da49384ec..7bfce6050 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/ParentDocumentImpl.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/ParentDocumentImpl.java @@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.MappedsuperclassPackage; import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.ParentDocument; +import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.TestReference; /** * <!-- begin-user-doc --> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/TestReferenceImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/TestReferenceImpl.java new file mode 100644 index 000000000..3e209273b --- /dev/null +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/impl/TestReferenceImpl.java @@ -0,0 +1,165 @@ +/** + * <copyright> + * </copyright> + * + * $Id$ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.MappedsuperclassPackage; +import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.TestReference; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Test Reference</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.impl.TestReferenceImpl#getName <em>Name</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class TestReferenceImpl extends EObjectImpl implements TestReference { + /** + * The default value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + /** + * The cached value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected TestReferenceImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return MappedsuperclassPackage.Literals.TEST_REFERENCE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getName() { + return name; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, MappedsuperclassPackage.TEST_REFERENCE__NAME, oldName, name)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case MappedsuperclassPackage.TEST_REFERENCE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case MappedsuperclassPackage.TEST_REFERENCE__NAME: + setName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case MappedsuperclassPackage.TEST_REFERENCE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case MappedsuperclassPackage.TEST_REFERENCE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //TestReferenceImpl diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mappedsuperclass.ecore b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mappedsuperclass.ecore index db3deef51..b775be70e 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mappedsuperclass.ecore +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mappedsuperclass.ecore @@ -34,6 +34,13 @@ <details key="name" value="myGenericInfo"/> </eAnnotations> </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EReference" name="myTestReference" lowerBound="1" + eType="#//TestReference" resolveProxies="false"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="element"/> + <details key="name" value="myTestReference"/> + </eAnnotations> + </eStructuralFeatures> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="ParentDocument" eSuperTypes="#//Document"> <eAnnotations source="teneo.jpa"> @@ -70,4 +77,19 @@ </eAnnotations> </eStructuralFeatures> </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="TestReference"> + <eAnnotations source="teneo.jpa"> + <details key="appinfo" value="@Entity"/> + </eAnnotations> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="name" value="TestReference"/> + <details key="kind" value="elementOnly"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="element"/> + <details key="name" value="name"/> + </eAnnotations> + </eStructuralFeatures> + </eClassifiers> </ecore:EPackage> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.genmodel b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.genmodel index 3fe71262c..5633ef58a 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.genmodel +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.genmodel @@ -12,6 +12,7 @@ </genClasses> <genClasses ecoreClass="mappedsuperclass.ecore#//Document"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mappedsuperclass.ecore#//Document/myGenericInfo"/> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference mappedsuperclass.ecore#//Document/myTestReference"/> </genClasses> <genClasses ecoreClass="mappedsuperclass.ecore#//ParentDocument"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mappedsuperclass.ecore#//ParentDocument/myName"/> @@ -19,5 +20,8 @@ <genClasses ecoreClass="mappedsuperclass.ecore#//SpecificDocument"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mappedsuperclass.ecore#//SpecificDocument/mySpecificInfo"/> </genClasses> + <genClasses ecoreClass="mappedsuperclass.ecore#//TestReference"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute mappedsuperclass.ecore#//TestReference/name"/> + </genClasses> </genPackages> </genmodel:GenModel> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.xsd b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.xsd index 6fee39563..5f9cbad2e 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.xsd +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/model/mps.xsd @@ -12,9 +12,19 @@ </xsd:annotation> <xsd:sequence> <xsd:element name="myGenericInfo" type="xsd:string" /> + <xsd:element name="myTestReference" type="xsd:IDREF" ecore:reference="this:TestReference"/> </xsd:sequence> </xsd:complexType> + <xsd:complexType name="TestReference"> + <xsd:annotation> + <xsd:appinfo source="teneo.jpa">@Entity</xsd:appinfo> + </xsd:annotation> + <xsd:sequence> + <xsd:element name="name" type="xsd:string" /> + </xsd:sequence> + </xsd:complexType> + <xsd:complexType name="AddIDDocument"> <xsd:annotation> <xsd:appinfo source="teneo.jpa">@Entity</xsd:appinfo> diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/util/MappedsuperclassAdapterFactory.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/util/MappedsuperclassAdapterFactory.java index 992915eb0..dfbbfce44 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/util/MappedsuperclassAdapterFactory.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/util/MappedsuperclassAdapterFactory.java @@ -64,7 +64,7 @@ public class MappedsuperclassAdapterFactory extends AdapterFactoryImpl { } /** - * The switch the delegates to the <code>createXXX</code> methods. + * The switch that delegates to the <code>createXXX</code> methods. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -88,6 +88,10 @@ public class MappedsuperclassAdapterFactory extends AdapterFactoryImpl { return createSpecificDocumentAdapter(); } @Override + public Adapter caseTestReference(TestReference object) { + return createTestReferenceAdapter(); + } + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); } @@ -164,6 +168,20 @@ public class MappedsuperclassAdapterFactory extends AdapterFactoryImpl { } /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.TestReference <em>Test Reference</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.teneo.samples.emf.annotations.mappedsuperclass.TestReference + * @generated + */ + public Adapter createTestReferenceAdapter() { + return null; + } + + /** * Creates a new adapter for the default case. * <!-- begin-user-doc --> * This default implementation returns null. diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/util/MappedsuperclassSwitch.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/util/MappedsuperclassSwitch.java index 10dbd0b8e..40b79110c 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/util/MappedsuperclassSwitch.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/mappedsuperclass/util/MappedsuperclassSwitch.java @@ -11,6 +11,8 @@ import java.util.List; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.Switch; import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.*; /** @@ -26,7 +28,7 @@ import org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.*; * @see org.eclipse.emf.teneo.samples.emf.annotations.mappedsuperclass.MappedsuperclassPackage * @generated */ -public class MappedsuperclassSwitch<T> { +public class MappedsuperclassSwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> @@ -48,34 +50,16 @@ public class MappedsuperclassSwitch<T> { } /** - * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the first non-null result returned by a <code>caseXXX</code> call. - * @generated - */ - public T doSwitch(EObject theEObject) { - return doSwitch(theEObject.eClass(), theEObject); - } - - /** - * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * Checks whether this is a switch for the given package. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @return the first non-null result returned by a <code>caseXXX</code> call. + * @parameter ePackage the package in question. + * @return whether this is a switch for the given package. * @generated */ - protected T doSwitch(EClass theEClass, EObject theEObject) { - if (theEClass.eContainer() == modelPackage) { - return doSwitch(theEClass.getClassifierID(), theEObject); - } - else { - List<EClass> eSuperTypes = theEClass.getESuperTypes(); - return - eSuperTypes.isEmpty() ? - defaultCase(theEObject) : - doSwitch(eSuperTypes.get(0), theEObject); - } + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; } /** @@ -85,6 +69,7 @@ public class MappedsuperclassSwitch<T> { * @return the first non-null result returned by a <code>caseXXX</code> call. * @generated */ + @Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case MappedsuperclassPackage.ADD_ID_DOCUMENT: { @@ -115,6 +100,12 @@ public class MappedsuperclassSwitch<T> { if (result == null) result = defaultCase(theEObject); return result; } + case MappedsuperclassPackage.TEST_REFERENCE: { + TestReference testReference = (TestReference)theEObject; + T result = caseTestReference(testReference); + if (result == null) result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } } @@ -180,6 +171,21 @@ public class MappedsuperclassSwitch<T> { } /** + * Returns the result of interpreting the object as an instance of '<em>Test Reference</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>Test Reference</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTestReference(TestReference object) { + return null; + } + + /** * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. * <!-- begin-user-doc --> * This implementation returns null; @@ -190,6 +196,7 @@ public class MappedsuperclassSwitch<T> { * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ + @Override public T defaultCase(EObject object) { return null; } |