diff options
author | Eike Stepper | 2011-07-26 05:54:41 +0000 |
---|---|---|
committer | Eike Stepper | 2011-07-26 05:54:41 +0000 |
commit | 0f8ed7d4359c117cf215b1789ea6e1989b3dbfad (patch) | |
tree | 0d8cbf44912d9d9f1f06465f884c5f1f7dc12699 /plugins/org.eclipse.emf.cdo.tests.model3 | |
parent | d175de7e5770859d4375ce952eb419465430892e (diff) | |
download | cdo-0f8ed7d4359c117cf215b1789ea6e1989b3dbfad.tar.gz cdo-0f8ed7d4359c117cf215b1789ea6e1989b3dbfad.tar.xz cdo-0f8ed7d4359c117cf215b1789ea6e1989b3dbfad.zip |
[349599] [CDO Tests] EMF runtime compatibility issue and duplicate code in test models
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349599
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests.model3')
10 files changed, 126 insertions, 1016 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.tests.model3/META-INF/MANIFEST.MF index f55df1a4ff..1554f2a24c 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model3/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.tests.model3/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.emf.cdo.tests.model3; singleton:=true -Bundle-Version: 3.0.100.qualifier +Bundle-Version: 3.0.200.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -14,11 +14,9 @@ Export-Package: org.eclipse.emf.cdo.tests.legacy.model3;version="3.0.100", org.eclipse.emf.cdo.tests.legacy.model3.impl;version="3.0.100", org.eclipse.emf.cdo.tests.legacy.model3.subpackage;version="3.0.100", org.eclipse.emf.cdo.tests.legacy.model3.subpackage.impl;version="3.0.100", - org.eclipse.emf.cdo.tests.legacy.model3.subpackage.util;version="3.0.100", - org.eclipse.emf.cdo.tests.legacy.model3.util;version="3.0.100", - org.eclipse.emf.cdo.tests.model3;version="3.0.100", - org.eclipse.emf.cdo.tests.model3.impl;version="3.0.100", - org.eclipse.emf.cdo.tests.model3.subpackage;version="3.0.100", - org.eclipse.emf.cdo.tests.model3.subpackage.impl;version="3.0.100", - org.eclipse.emf.cdo.tests.model3.subpackage.util;version="3.0.100", - org.eclipse.emf.cdo.tests.model3.util;version="3.0.100" + org.eclipse.emf.cdo.tests.model3;version="3.0.200", + org.eclipse.emf.cdo.tests.model3.impl;version="3.0.200", + org.eclipse.emf.cdo.tests.model3.subpackage;version="3.0.200", + org.eclipse.emf.cdo.tests.model3.subpackage.impl;version="3.0.200", + org.eclipse.emf.cdo.tests.model3.subpackage.util;version="3.0.200", + org.eclipse.emf.cdo.tests.model3.util;version="3.0.200" diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/model/model3-legacy.genmodel b/plugins/org.eclipse.emf.cdo.tests.model3/model/model3-legacy.genmodel index b829d2af7b..a7028964c1 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model3/model/model3-legacy.genmodel +++ b/plugins/org.eclipse.emf.cdo.tests.model3/model/model3-legacy.genmodel @@ -5,7 +5,7 @@ modelDirectory="/org.eclipse.emf.cdo.tests.model3/src" editDirectory="" editorDirectory="" modelPluginID="org.eclipse.emf.cdo.tests.model3" modelName="Model3" updateClasspath="false" codeFormatting="true" testsDirectory="" importerID="org.eclipse.emf.importer.ecore" - complianceLevel="5.0" copyrightFields="false" usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../org.eclipse.emf.cdo/model/etypes.genmodel#//etypes"> + complianceLevel="5.0" copyrightFields="false" runtimeVersion="2.6" usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../org.eclipse.emf.cdo/model/etypes.genmodel#//etypes"> <foreignModel>model3.ecore</foreignModel> <modelPluginVariables>CDO=org.eclipse.emf.cdo</modelPluginVariables> <genPackages prefix="Model3" basePackage="org.eclipse.emf.cdo.tests.legacy" disposableProviderFactory="true" @@ -58,6 +58,9 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model3.ecore#//File/name"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model3.ecore#//File/data"/> </genClasses> + <genClasses ecoreClass="model3.ecore#//ClassWithIDAttribute"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model3.ecore#//ClassWithIDAttribute/id"/> + </genClasses> <nestedGenPackages prefix="Subpackage" basePackage="org.eclipse.emf.cdo.tests.legacy.model3" disposableProviderFactory="true" ecorePackage="model3.ecore#//subpackage"> <genClasses ecoreClass="model3.ecore#//subpackage/Class2"> diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.genmodel b/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.genmodel index 2e539ba97c..6a68ccf8df 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.genmodel +++ b/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.genmodel @@ -6,7 +6,8 @@ modelPluginID="org.eclipse.emf.cdo.tests.model3" modelName="Model3" updateClasspath="false" rootExtendsClass="org.eclipse.emf.internal.cdo.CDOObjectImpl" reflectiveDelegation="true" codeFormatting="true" testsDirectory="" importerID="org.eclipse.emf.importer.ecore" - featureDelegation="Reflective" complianceLevel="5.0" copyrightFields="false" usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../org.eclipse.emf.cdo/model/etypes.genmodel#//etypes"> + featureDelegation="Reflective" complianceLevel="5.0" copyrightFields="false" runtimeVersion="2.6" + usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../org.eclipse.emf.cdo/model/etypes.genmodel#//etypes"> <foreignModel>model3.ecore</foreignModel> <modelPluginVariables>CDO=org.eclipse.emf.cdo</modelPluginVariables> <genPackages prefix="Model3" basePackage="org.eclipse.emf.cdo.tests" disposableProviderFactory="true" @@ -59,6 +60,9 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model3.ecore#//File/name"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model3.ecore#//File/data"/> </genClasses> + <genClasses ecoreClass="model3.ecore#//ClassWithIDAttribute"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model3.ecore#//ClassWithIDAttribute/id"/> + </genClasses> <nestedGenPackages prefix="Subpackage" basePackage="org.eclipse.emf.cdo.tests.model3" disposableProviderFactory="true" ecorePackage="model3.ecore#//subpackage"> <genClasses ecoreClass="model3.ecore#//subpackage/Class2"> diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3PackageImpl.java index cc8cf9aa87..f8bdc29606 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3PackageImpl.java +++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/impl/Model3PackageImpl.java @@ -167,7 +167,9 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package public static Model3Package init() { if (isInited) + { return (Model3Package)EPackage.Registry.INSTANCE.getEPackage(Model3Package.eNS_URI); + } // Obtain or create and register package Model3PackageImpl theModel3Package = (Model3PackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof Model3PackageImpl ? EPackage.Registry.INSTANCE @@ -625,7 +627,9 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package public void createPackageContents() { if (isCreated) + { return; + } isCreated = true; // Create classes and their features @@ -699,7 +703,9 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package public void initializePackageContents() { if (isInitialized) + { return; + } isInitialized = true; // Initialize package @@ -740,66 +746,65 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(polygonEClass, Polygon.class, "Polygon", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPolygon_Points(), this.getPoint(), "points", null, 1, -1, Polygon.class, !IS_TRANSIENT, - !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getPolygon_Points(), getPoint(), "points", null, 1, -1, Polygon.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(polygonWithDuplicatesEClass, PolygonWithDuplicates.class, "PolygonWithDuplicates", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPolygonWithDuplicates_Points(), this.getPoint(), "points", null, 1, -1, - PolygonWithDuplicates.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, - !IS_DERIVED, IS_ORDERED); + initEAttribute(getPolygonWithDuplicates_Points(), getPoint(), "points", null, 1, -1, PolygonWithDuplicates.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(nodeAEClass, NodeA.class, "NodeA", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getNodeA_Children(), this.getNodeA(), null, "children", null, 0, -1, NodeA.class, !IS_TRANSIENT, + initEReference(getNodeA_Children(), getNodeA(), null, "children", null, 0, -1, NodeA.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getNodeA_Name(), theEcorePackage.getEString(), "name", null, 0, 1, NodeA.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getNodeA_OtherNodes(), this.getNodeA(), null, "otherNodes", null, 0, -1, NodeA.class, !IS_TRANSIENT, + initEReference(getNodeA_OtherNodes(), getNodeA(), null, "otherNodes", null, 0, -1, NodeA.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(nodeBEClass, NodeB.class, "NodeB", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getNodeB_Children(), this.getNodeB(), this.getNodeB_Parent(), "children", null, 0, -1, NodeB.class, + initEReference(getNodeB_Children(), getNodeB(), getNodeB_Parent(), "children", null, 0, -1, NodeB.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getNodeB_Parent(), this.getNodeB(), this.getNodeB_Children(), "parent", null, 0, 1, NodeB.class, + initEReference(getNodeB_Parent(), getNodeB(), getNodeB_Children(), "parent", null, 0, 1, NodeB.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getNodeB_Name(), theEcorePackage.getEString(), "name", null, 0, 1, NodeB.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(nodeCEClass, NodeC.class, "NodeC", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getNodeC_Children(), this.getNodeC(), this.getNodeC_Parent(), "children", null, 0, -1, NodeC.class, + initEReference(getNodeC_Children(), getNodeC(), getNodeC_Parent(), "children", null, 0, -1, NodeC.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getNodeC_Parent(), this.getNodeC(), this.getNodeC_Children(), "parent", null, 0, 1, NodeC.class, + initEReference(getNodeC_Parent(), getNodeC(), getNodeC_Children(), "parent", null, 0, 1, NodeC.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getNodeC_Name(), theEcorePackage.getEString(), "name", null, 0, 1, NodeC.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getNodeC_OtherNodes(), this.getNodeC(), this.getNodeC_OppositeNodes(), "otherNodes", null, 0, -1, - NodeC.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getNodeC_OppositeNodes(), this.getNodeC(), this.getNodeC_OtherNodes(), "oppositeNodes", null, 0, -1, + initEReference(getNodeC_OtherNodes(), getNodeC(), getNodeC_OppositeNodes(), "otherNodes", null, 0, -1, NodeC.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEReference(getNodeC_OppositeNodes(), getNodeC(), getNodeC_OtherNodes(), "oppositeNodes", null, 0, -1, NodeC.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(nodeDEClass, NodeD.class, "NodeD", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getNodeD_Children(), this.getNodeD(), this.getNodeD_Parent(), "children", null, 0, -1, NodeD.class, + initEReference(getNodeD_Children(), getNodeD(), getNodeD_Parent(), "children", null, 0, -1, NodeD.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getNodeD_Parent(), this.getNodeD(), this.getNodeD_Children(), "parent", null, 0, 1, NodeD.class, + initEReference(getNodeD_Parent(), getNodeD(), getNodeD_Children(), "parent", null, 0, 1, NodeD.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getNodeD_Name(), theEcorePackage.getEString(), "name", null, 0, 1, NodeD.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getNodeD_OtherNodes(), this.getNodeD(), this.getNodeD_OppositeNode(), "otherNodes", null, 0, -1, - NodeD.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getNodeD_OppositeNode(), this.getNodeD(), this.getNodeD_OtherNodes(), "oppositeNode", null, 0, 1, - NodeD.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getNodeD_OtherNodes(), getNodeD(), getNodeD_OppositeNode(), "otherNodes", null, 0, -1, NodeD.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEReference(getNodeD_OppositeNode(), getNodeD(), getNodeD_OtherNodes(), "oppositeNode", null, 0, 1, NodeD.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); initEClass(imageEClass, Image.class, "Image", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getImage_Width(), theEcorePackage.getEInt(), "width", null, 0, 1, Image.class, !IS_TRANSIENT, diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/subpackage/util/SubpackageAdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/subpackage/util/SubpackageAdapterFactory.java deleted file mode 100644 index 3b7549386e..0000000000 --- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/subpackage/util/SubpackageAdapterFactory.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * Copyright (c) 2004 - 2011 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: - * Eike Stepper - initial API and implementation - */ -package org.eclipse.emf.cdo.tests.legacy.model3.subpackage.util; - -import org.eclipse.emf.cdo.tests.legacy.model3.subpackage.SubpackagePackage; -import org.eclipse.emf.cdo.tests.model3.subpackage.Class2; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; - -/** - * <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides an adapter <code>createXXX</code> - * method for each class of the model. <!-- end-user-doc --> - * - * @see org.eclipse.emf.cdo.tests.legacy.model3.subpackage.SubpackagePackage - * @generated - */ -public class SubpackageAdapterFactory extends AdapterFactoryImpl -{ - /** - * The cached model package. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected static SubpackagePackage modelPackage; - - /** - * Creates an instance of the adapter factory. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public SubpackageAdapterFactory() - { - if (modelPackage == null) - { - modelPackage = SubpackagePackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. <!-- begin-user-doc --> This implementation - * returns <code>true</code> if the object is either the model's package or is an instance object of the model. <!-- - * end-user-doc --> - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) - { - if (object == modelPackage) - { - return true; - } - if (object instanceof EObject) - { - return ((EObject)object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch that delegates to the <code>createXXX</code> methods. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected SubpackageSwitch<Adapter> modelSwitch = new SubpackageSwitch<Adapter>() - { - @Override - public Adapter caseClass2(Class2 object) - { - return createClass2Adapter(); - } - - @Override - public Adapter defaultCase(EObject object) - { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the <code>target</code>. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @param target - * the object to adapt. - * @return the adapter for the <code>target</code>. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) - { - return modelSwitch.doSwitch((EObject)target); - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.subpackage.Class2 - * <em>Class2</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.legacy.model3.subpackage.Class2 - * @generated - */ - public Adapter createClass2Adapter() - { - 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; - } - -} // SubpackageAdapterFactory diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/subpackage/util/SubpackageSwitch.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/subpackage/util/SubpackageSwitch.java deleted file mode 100644 index 12f2284e20..0000000000 --- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/subpackage/util/SubpackageSwitch.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Copyright (c) 2004 - 2011 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: - * Eike Stepper - initial API and implementation - */ -package org.eclipse.emf.cdo.tests.legacy.model3.subpackage.util; - -import org.eclipse.emf.cdo.tests.legacy.model3.subpackage.SubpackagePackage; -import org.eclipse.emf.cdo.tests.model3.subpackage.Class2; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.util.Switch; - -/** - * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance hierarchy. It supports the call - * {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each class of the model, - * starting with the actual class of the object and proceeding up the inheritance hierarchy until a non-null result is - * returned, which is the result of the switch. <!-- end-user-doc --> - * - * @see org.eclipse.emf.cdo.tests.legacy.model3.subpackage.SubpackagePackage - * @generated - */ -public class SubpackageSwitch<T> extends Switch<T> -{ - /** - * The cached model package <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected static SubpackagePackage modelPackage; - - /** - * Creates an instance of the switch. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public SubpackageSwitch() - { - if (modelPackage == null) - { - modelPackage = SubpackagePackage.eINSTANCE; - } - } - - /** - * Checks whether this is a switch for the given package. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @parameter ePackage the package in question. - * @return whether this is a switch for the given package. - * @generated - */ - @Override - protected boolean isSwitchFor(EPackage ePackage) - { - return ePackage == modelPackage; - } - - /** - * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @return the first non-null result returned by a <code>caseXXX</code> call. - * @generated - */ - @Override - protected T doSwitch(int classifierID, EObject theEObject) - { - switch (classifierID) - { - case SubpackagePackage.CLASS2: - { - Class2 class2 = (Class2)theEObject; - T result = caseClass2(class2); - if (result == null) - result = defaultCase(theEObject); - return result; - } - default: - return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Class2</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>Class2</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseClass2(Class2 object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. <!-- begin-user-doc --> This - * implementation returns null; returning a non-null result will terminate the switch, but this is the last case - * anyway. <!-- end-user-doc --> - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of '<em>EObject</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - @Override - public T defaultCase(EObject object) - { - return null; - } - -} // SubpackageSwitch diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3AdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3AdapterFactory.java deleted file mode 100644 index 4b01541434..0000000000 --- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3AdapterFactory.java +++ /dev/null @@ -1,344 +0,0 @@ -/** - * Copyright (c) 2004 - 2011 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: - * Eike Stepper - initial API and implementation - */ -package org.eclipse.emf.cdo.tests.legacy.model3.util; - -import org.eclipse.emf.cdo.tests.legacy.model3.Model3Package; -import org.eclipse.emf.cdo.tests.model3.Class1; -import org.eclipse.emf.cdo.tests.model3.ClassWithIDAttribute; -import org.eclipse.emf.cdo.tests.model3.File; -import org.eclipse.emf.cdo.tests.model3.Image; -import org.eclipse.emf.cdo.tests.model3.MetaRef; -import org.eclipse.emf.cdo.tests.model3.NodeA; -import org.eclipse.emf.cdo.tests.model3.NodeB; -import org.eclipse.emf.cdo.tests.model3.NodeC; -import org.eclipse.emf.cdo.tests.model3.NodeD; -import org.eclipse.emf.cdo.tests.model3.Polygon; -import org.eclipse.emf.cdo.tests.model3.PolygonWithDuplicates; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; - -/** - * <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides an adapter <code>createXXX</code> - * method for each class of the model. <!-- end-user-doc --> - * - * @see org.eclipse.emf.cdo.tests.legacy.model3.Model3Package - * @generated - */ -public class Model3AdapterFactory extends AdapterFactoryImpl -{ - /** - * The cached model package. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected static Model3Package modelPackage; - - /** - * Creates an instance of the adapter factory. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Model3AdapterFactory() - { - if (modelPackage == null) - { - modelPackage = Model3Package.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. <!-- begin-user-doc --> This implementation - * returns <code>true</code> if the object is either the model's package or is an instance object of the model. <!-- - * end-user-doc --> - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) - { - if (object == modelPackage) - { - return true; - } - if (object instanceof EObject) - { - return ((EObject)object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch that delegates to the <code>createXXX</code> methods. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected Model3Switch<Adapter> modelSwitch = new Model3Switch<Adapter>() - { - @Override - public Adapter caseClass1(Class1 object) - { - return createClass1Adapter(); - } - - @Override - public Adapter caseMetaRef(MetaRef object) - { - return createMetaRefAdapter(); - } - - @Override - public Adapter casePolygon(Polygon object) - { - return createPolygonAdapter(); - } - - @Override - public Adapter casePolygonWithDuplicates(PolygonWithDuplicates object) - { - return createPolygonWithDuplicatesAdapter(); - } - - @Override - public Adapter caseNodeA(NodeA object) - { - return createNodeAAdapter(); - } - - @Override - public Adapter caseNodeB(NodeB object) - { - return createNodeBAdapter(); - } - - @Override - public Adapter caseNodeC(NodeC object) - { - return createNodeCAdapter(); - } - - @Override - public Adapter caseNodeD(NodeD object) - { - return createNodeDAdapter(); - } - - @Override - public Adapter caseImage(Image object) - { - return createImageAdapter(); - } - - @Override - public Adapter caseFile(File object) - { - return createFileAdapter(); - } - - @Override - public Adapter caseClassWithIDAttribute(ClassWithIDAttribute object) - { - return createClassWithIDAttributeAdapter(); - } - - @Override - public Adapter defaultCase(EObject object) - { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the <code>target</code>. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @param target - * the object to adapt. - * @return the adapter for the <code>target</code>. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) - { - return modelSwitch.doSwitch((EObject)target); - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.Class1 - * <em>Class1</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.legacy.model3.Class1 - * @generated - */ - public Adapter createClass1Adapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.MetaRef - * <em>Meta Ref</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.legacy.model3.MetaRef - * @generated - */ - public Adapter createMetaRefAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.Polygon - * <em>Polygon</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.legacy.model3.Polygon - * @generated - */ - public Adapter createPolygonAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.PolygonWithDuplicates - * <em>Polygon With Duplicates</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.legacy.model3.PolygonWithDuplicates - * @generated - */ - public Adapter createPolygonWithDuplicatesAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.NodeA <em>Node A</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.legacy.model3.NodeA - * @generated - */ - public Adapter createNodeAAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.NodeB <em>Node B</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.legacy.model3.NodeB - * @generated - */ - public Adapter createNodeBAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.NodeC <em>Node C</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.legacy.model3.NodeC - * @generated - */ - public Adapter createNodeCAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.NodeD <em>Node D</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.legacy.model3.NodeD - * @generated - */ - public Adapter createNodeDAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.Image <em>Image</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.legacy.model3.Image - * @generated - */ - public Adapter createImageAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.File <em>File</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.legacy.model3.File - * @generated - */ - public Adapter createFileAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.legacy.model3.ClassWithIDAttribute - * <em>Class With ID Attribute</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.legacy.model3.ClassWithIDAttribute - * @generated - */ - public Adapter createClassWithIDAttributeAdapter() - { - 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; - } - -} // Model3AdapterFactory diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3Switch.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3Switch.java deleted file mode 100644 index 6c8eced6a3..0000000000 --- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/legacy/model3/util/Model3Switch.java +++ /dev/null @@ -1,363 +0,0 @@ -/** - * Copyright (c) 2004 - 2011 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: - * Eike Stepper - initial API and implementation - */ -package org.eclipse.emf.cdo.tests.legacy.model3.util; - -import org.eclipse.emf.cdo.tests.legacy.model3.Model3Package; -import org.eclipse.emf.cdo.tests.model3.Class1; -import org.eclipse.emf.cdo.tests.model3.ClassWithIDAttribute; -import org.eclipse.emf.cdo.tests.model3.File; -import org.eclipse.emf.cdo.tests.model3.Image; -import org.eclipse.emf.cdo.tests.model3.MetaRef; -import org.eclipse.emf.cdo.tests.model3.NodeA; -import org.eclipse.emf.cdo.tests.model3.NodeB; -import org.eclipse.emf.cdo.tests.model3.NodeC; -import org.eclipse.emf.cdo.tests.model3.NodeD; -import org.eclipse.emf.cdo.tests.model3.Polygon; -import org.eclipse.emf.cdo.tests.model3.PolygonWithDuplicates; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.util.Switch; - -/** - * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance hierarchy. It supports the call - * {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each class of the model, - * starting with the actual class of the object and proceeding up the inheritance hierarchy until a non-null result is - * returned, which is the result of the switch. <!-- end-user-doc --> - * - * @see org.eclipse.emf.cdo.tests.legacy.model3.Model3Package - * @generated - */ -public class Model3Switch<T> extends Switch<T> -{ - /** - * The cached model package <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected static Model3Package modelPackage; - - /** - * Creates an instance of the switch. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Model3Switch() - { - if (modelPackage == null) - { - modelPackage = Model3Package.eINSTANCE; - } - } - - /** - * Checks whether this is a switch for the given package. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @parameter ePackage the package in question. - * @return whether this is a switch for the given package. - * @generated - */ - @Override - protected boolean isSwitchFor(EPackage ePackage) - { - return ePackage == modelPackage; - } - - /** - * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @return the first non-null result returned by a <code>caseXXX</code> call. - * @generated - */ - @Override - protected T doSwitch(int classifierID, EObject theEObject) - { - switch (classifierID) - { - case Model3Package.CLASS1: - { - Class1 class1 = (Class1)theEObject; - T result = caseClass1(class1); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case Model3Package.META_REF: - { - MetaRef metaRef = (MetaRef)theEObject; - T result = caseMetaRef(metaRef); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case Model3Package.POLYGON: - { - Polygon polygon = (Polygon)theEObject; - T result = casePolygon(polygon); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case Model3Package.POLYGON_WITH_DUPLICATES: - { - PolygonWithDuplicates polygonWithDuplicates = (PolygonWithDuplicates)theEObject; - T result = casePolygonWithDuplicates(polygonWithDuplicates); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case Model3Package.NODE_A: - { - NodeA nodeA = (NodeA)theEObject; - T result = caseNodeA(nodeA); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case Model3Package.NODE_B: - { - NodeB nodeB = (NodeB)theEObject; - T result = caseNodeB(nodeB); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case Model3Package.NODE_C: - { - NodeC nodeC = (NodeC)theEObject; - T result = caseNodeC(nodeC); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case Model3Package.NODE_D: - { - NodeD nodeD = (NodeD)theEObject; - T result = caseNodeD(nodeD); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case Model3Package.IMAGE: - { - Image image = (Image)theEObject; - T result = caseImage(image); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case Model3Package.FILE: - { - File file = (File)theEObject; - T result = caseFile(file); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case Model3Package.CLASS_WITH_ID_ATTRIBUTE: - { - ClassWithIDAttribute classWithIDAttribute = (ClassWithIDAttribute)theEObject; - T result = caseClassWithIDAttribute(classWithIDAttribute); - if (result == null) - result = defaultCase(theEObject); - return result; - } - default: - return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Class1</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>Class1</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseClass1(Class1 object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Meta Ref</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>Meta Ref</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseMetaRef(MetaRef object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Polygon</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>Polygon</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePolygon(Polygon object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Polygon With Duplicates</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>Polygon With Duplicates</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePolygonWithDuplicates(PolygonWithDuplicates object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Node A</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>Node A</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseNodeA(NodeA object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Node B</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>Node B</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseNodeB(NodeB object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Node C</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>Node C</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseNodeC(NodeC object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Node D</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>Node D</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseNodeD(NodeD object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Image</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>Image</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseImage(Image object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>File</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>File</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseFile(File object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Class With ID Attribute</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>Class With ID Attribute</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseClassWithIDAttribute(ClassWithIDAttribute object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. <!-- begin-user-doc --> This - * implementation returns null; returning a non-null result will terminate the switch, but this is the last case - * anyway. <!-- end-user-doc --> - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of '<em>EObject</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - @Override - public T defaultCase(EObject object) - { - return null; - } - -} // Model3Switch diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/subpackage/util/SubpackageSwitch.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/subpackage/util/SubpackageSwitch.java index bd7f35e003..7f411a2997 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/subpackage/util/SubpackageSwitch.java +++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/subpackage/util/SubpackageSwitch.java @@ -13,9 +13,10 @@ package org.eclipse.emf.cdo.tests.model3.subpackage.util; import org.eclipse.emf.cdo.tests.model3.subpackage.Class2; import org.eclipse.emf.cdo.tests.model3.subpackage.SubpackagePackage; +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 java.util.List; /** * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance hierarchy. It supports the call @@ -26,7 +27,7 @@ import org.eclipse.emf.ecore.util.Switch; * @see org.eclipse.emf.cdo.tests.model3.subpackage.SubpackagePackage * @generated */ -public class SubpackageSwitch<T> extends Switch<T> +public class SubpackageSwitch<T> { /** * The cached model package <!-- begin-user-doc --> <!-- end-user-doc --> @@ -49,16 +50,35 @@ public class SubpackageSwitch<T> extends Switch<T> } /** - * Checks whether this is a switch for the given package. <!-- begin-user-doc --> <!-- end-user-doc --> + * 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. + * <!-- begin-user-doc --> <!-- end-user-doc --> * - * @parameter ePackage the package in question. - * @return whether this is a switch for the given package. + * @return the first non-null result returned by a <code>caseXXX</code> call. * @generated */ - @Override - protected boolean isSwitchFor(EPackage ePackage) + protected T doSwitch(EClass theEClass, EObject theEObject) { - return ePackage == modelPackage; + 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); + } } /** @@ -68,7 +88,6 @@ public class SubpackageSwitch<T> extends Switch<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) @@ -78,7 +97,9 @@ public class SubpackageSwitch<T> extends Switch<T> Class2 class2 = (Class2)theEObject; T result = caseClass2(class2); if (result == null) + { result = defaultCase(theEObject); + } return result; } default: @@ -112,7 +133,6 @@ public class SubpackageSwitch<T> extends Switch<T> * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ - @Override public T defaultCase(EObject object) { return null; diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java index 32c274234f..e48cdf7b5f 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java +++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java @@ -23,9 +23,10 @@ import org.eclipse.emf.cdo.tests.model3.NodeD; import org.eclipse.emf.cdo.tests.model3.Polygon; import org.eclipse.emf.cdo.tests.model3.PolygonWithDuplicates; +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 java.util.List; /** * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance hierarchy. It supports the call @@ -36,7 +37,7 @@ import org.eclipse.emf.ecore.util.Switch; * @see org.eclipse.emf.cdo.tests.model3.Model3Package * @generated */ -public class Model3Switch<T> extends Switch<T> +public class Model3Switch<T> { /** * The cached model package <!-- begin-user-doc --> <!-- end-user-doc --> @@ -59,16 +60,35 @@ public class Model3Switch<T> extends Switch<T> } /** - * Checks whether this is a switch for the given package. <!-- begin-user-doc --> <!-- end-user-doc --> + * 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. + * <!-- begin-user-doc --> <!-- end-user-doc --> * - * @parameter ePackage the package in question. - * @return whether this is a switch for the given package. + * @return the first non-null result returned by a <code>caseXXX</code> call. * @generated */ - @Override - protected boolean isSwitchFor(EPackage ePackage) + protected T doSwitch(EClass theEClass, EObject theEObject) { - return ePackage == modelPackage; + 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); + } } /** @@ -78,7 +98,6 @@ public class Model3Switch<T> extends Switch<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) @@ -88,7 +107,9 @@ public class Model3Switch<T> extends Switch<T> Class1 class1 = (Class1)theEObject; T result = caseClass1(class1); if (result == null) + { result = defaultCase(theEObject); + } return result; } case Model3Package.META_REF: @@ -96,7 +117,9 @@ public class Model3Switch<T> extends Switch<T> MetaRef metaRef = (MetaRef)theEObject; T result = caseMetaRef(metaRef); if (result == null) + { result = defaultCase(theEObject); + } return result; } case Model3Package.POLYGON: @@ -104,7 +127,9 @@ public class Model3Switch<T> extends Switch<T> Polygon polygon = (Polygon)theEObject; T result = casePolygon(polygon); if (result == null) + { result = defaultCase(theEObject); + } return result; } case Model3Package.POLYGON_WITH_DUPLICATES: @@ -112,7 +137,9 @@ public class Model3Switch<T> extends Switch<T> PolygonWithDuplicates polygonWithDuplicates = (PolygonWithDuplicates)theEObject; T result = casePolygonWithDuplicates(polygonWithDuplicates); if (result == null) + { result = defaultCase(theEObject); + } return result; } case Model3Package.NODE_A: @@ -120,7 +147,9 @@ public class Model3Switch<T> extends Switch<T> NodeA nodeA = (NodeA)theEObject; T result = caseNodeA(nodeA); if (result == null) + { result = defaultCase(theEObject); + } return result; } case Model3Package.NODE_B: @@ -128,7 +157,9 @@ public class Model3Switch<T> extends Switch<T> NodeB nodeB = (NodeB)theEObject; T result = caseNodeB(nodeB); if (result == null) + { result = defaultCase(theEObject); + } return result; } case Model3Package.NODE_C: @@ -136,7 +167,9 @@ public class Model3Switch<T> extends Switch<T> NodeC nodeC = (NodeC)theEObject; T result = caseNodeC(nodeC); if (result == null) + { result = defaultCase(theEObject); + } return result; } case Model3Package.NODE_D: @@ -144,7 +177,9 @@ public class Model3Switch<T> extends Switch<T> NodeD nodeD = (NodeD)theEObject; T result = caseNodeD(nodeD); if (result == null) + { result = defaultCase(theEObject); + } return result; } case Model3Package.IMAGE: @@ -152,7 +187,9 @@ public class Model3Switch<T> extends Switch<T> Image image = (Image)theEObject; T result = caseImage(image); if (result == null) + { result = defaultCase(theEObject); + } return result; } case Model3Package.FILE: @@ -160,7 +197,9 @@ public class Model3Switch<T> extends Switch<T> File file = (File)theEObject; T result = caseFile(file); if (result == null) + { result = defaultCase(theEObject); + } return result; } case Model3Package.CLASS_WITH_ID_ATTRIBUTE: @@ -168,7 +207,9 @@ public class Model3Switch<T> extends Switch<T> ClassWithIDAttribute classWithIDAttribute = (ClassWithIDAttribute)theEObject; T result = caseClassWithIDAttribute(classWithIDAttribute); if (result == null) + { result = defaultCase(theEObject); + } return result; } default: @@ -354,7 +395,6 @@ public class Model3Switch<T> extends Switch<T> * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ - @Override public T defaultCase(EObject object) { return null; |