+ * The following features are supported: + *
+ *+ * If the meaning of the 'Super Mains' containment reference list isn't clear, + * there really should be more of a description here... + *
+ * + * @return the value of the 'Super Mains' containment reference list. + * @see org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage#getSubMain_SuperMains() + * @model containment="true" + * @generated + */ + EList+ * If the meaning of the 'Another' containment reference isn't clear, + * there really should be more of a description here... + *
+ * + * @return the value of the 'Another' containment reference. + * @see #setAnother(AnotherSuperMain) + * @see org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage#getSubMain_Another() + * @model containment="true" + * @generated + */ + AnotherSuperMain getAnother(); + + /** + * Sets the value of the '{@link org.eclipse.xtext.generator.ecore.subPackage.SubMain#getAnother Another}' containment reference. + * + * + * @param value the new value of the 'Another' containment reference. + * @see #getAnother() + * @generated + */ + void setAnother(AnotherSuperMain value); + +} // SubMain diff --git a/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/subPackage/SubPackageFactory.java b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/subPackage/SubPackageFactory.java new file mode 100644 index 000000000..876ddf9c0 --- /dev/null +++ b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/subPackage/SubPackageFactory.java @@ -0,0 +1,53 @@ +/** + * generated by Xtext + */ +package org.eclipse.xtext.generator.ecore.subPackage; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage + * @generated + */ +public interface SubPackageFactory extends EFactory +{ + /** + * The singleton instance of the factory. + * + * + * @generated + */ + SubPackageFactory eINSTANCE = org.eclipse.xtext.generator.ecore.subPackage.impl.SubPackageFactoryImpl.init(); + + /** + * Returns a new object of class 'Sub Main'. + * + * + * @return a new object of class 'Sub Main'. + * @generated + */ + SubMain createSubMain(); + + /** + * Returns a new object of class 'Another Super Main'. + * + * + * @return a new object of class 'Another Super Main'. + * @generated + */ + AnotherSuperMain createAnotherSuperMain(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + SubPackagePackage getSubPackagePackage(); + +} //SubPackageFactory diff --git a/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/subPackage/SubPackagePackage.java b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/subPackage/SubPackagePackage.java new file mode 100644 index 000000000..a0ba7bc04 --- /dev/null +++ b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/subPackage/SubPackagePackage.java @@ -0,0 +1,230 @@ +/** + * generated by Xtext + */ +package org.eclipse.xtext.generator.ecore.subPackage; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *+ * The following features are implemented: + *
+ *Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage#eNS_URI + * @see #init() + * @generated + */ + private SubPackagePackageImpl() + { + super(eNS_URI, SubPackageFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *
This method is used to initialize {@link SubPackagePackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ *
+ *
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static SubPackagePackage init()
+ {
+ if (isInited) return (SubPackagePackage)EPackage.Registry.INSTANCE.getEPackage(SubPackagePackage.eNS_URI);
+
+ // Obtain or create and register package
+ SubPackagePackageImpl theSubPackagePackage = (SubPackagePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof SubPackagePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new SubPackagePackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ SuperPackagePackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theSubPackagePackage.createPackageContents();
+
+ // Initialize created meta-data
+ theSubPackagePackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theSubPackagePackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(SubPackagePackage.eNS_URI, theSubPackagePackage);
+ return theSubPackagePackage;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getSubMain()
+ {
+ return subMainEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getSubMain_SuperMains()
+ {
+ return (EReference)subMainEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EReference getSubMain_Another()
+ {
+ return (EReference)subMainEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getAnotherSuperMain()
+ {
+ return anotherSuperMainEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public SubPackageFactory getSubPackageFactory()
+ {
+ return (SubPackageFactory)getEFactoryInstance();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ *
+ *
+ * @generated
+ */
+ public void createPackageContents()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ subMainEClass = createEClass(SUB_MAIN);
+ createEReference(subMainEClass, SUB_MAIN__SUPER_MAINS);
+ createEReference(subMainEClass, SUB_MAIN__ANOTHER);
+
+ anotherSuperMainEClass = createEClass(ANOTHER_SUPER_MAIN);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ *
+ *
+ * @generated
+ */
+ public void initializePackageContents()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ SuperPackagePackage theSuperPackagePackage = (SuperPackagePackage)EPackage.Registry.INSTANCE.getEPackage(SuperPackagePackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ anotherSuperMainEClass.getESuperTypes().add(theSuperPackagePackage.getAnotherSuperMain());
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(subMainEClass, SubMain.class, "SubMain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getSubMain_SuperMains(), theSuperPackagePackage.getSuperMain(), null, "superMains", null, 0, -1, SubMain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getSubMain_Another(), this.getAnotherSuperMain(), null, "another", null, 0, 1, SubMain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(anotherSuperMainEClass, AnotherSuperMain.class, "AnotherSuperMain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //SubPackagePackageImpl
diff --git a/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/subPackage/util/SubPackageAdapterFactory.java b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/subPackage/util/SubPackageAdapterFactory.java
new file mode 100644
index 000000000..0d1777cdd
--- /dev/null
+++ b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/subPackage/util/SubPackageAdapterFactory.java
@@ -0,0 +1,173 @@
+/**
+ * generated by Xtext
+ */
+package org.eclipse.xtext.generator.ecore.subPackage.util;
+
+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;
+
+import org.eclipse.xtext.generator.ecore.subPackage.*;
+
+/**
+ *
+ * The Adapter Factory for the model.
+ * It provides an adapter
+ * The following features are supported:
+ *
+ * If the meaning of the 'Name' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ * The following features are supported:
+ *
+ * If the meaning of the 'Name' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ * The following features are implemented:
+ *
+ * The following features are implemented:
+ * Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ *
+ *
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private SuperPackagePackageImpl()
+ {
+ super(eNS_URI, SuperPackageFactory.eINSTANCE);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the Package for this model, and for any others upon which it depends.
+ *
+ * This method is used to initialize {@link SuperPackagePackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ *
+ *
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static SuperPackagePackage init()
+ {
+ if (isInited) return (SuperPackagePackage)EPackage.Registry.INSTANCE.getEPackage(SuperPackagePackage.eNS_URI);
+
+ // Obtain or create and register package
+ SuperPackagePackageImpl theSuperPackagePackage = (SuperPackagePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof SuperPackagePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new SuperPackagePackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ EcorePackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theSuperPackagePackage.createPackageContents();
+
+ // Initialize created meta-data
+ theSuperPackagePackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theSuperPackagePackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(SuperPackagePackage.eNS_URI, theSuperPackagePackage);
+ return theSuperPackagePackage;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getSuperMain()
+ {
+ return superMainEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getSuperMain_Name()
+ {
+ return (EAttribute)superMainEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EClass getAnotherSuperMain()
+ {
+ return anotherSuperMainEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public EAttribute getAnotherSuperMain_Name()
+ {
+ return (EAttribute)anotherSuperMainEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public SuperPackageFactory getSuperPackageFactory()
+ {
+ return (SuperPackageFactory)getEFactoryInstance();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ *
+ *
+ * @generated
+ */
+ public void createPackageContents()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ superMainEClass = createEClass(SUPER_MAIN);
+ createEAttribute(superMainEClass, SUPER_MAIN__NAME);
+
+ anotherSuperMainEClass = createEClass(ANOTHER_SUPER_MAIN);
+ createEAttribute(anotherSuperMainEClass, ANOTHER_SUPER_MAIN__NAME);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ *
+ *
+ * @generated
+ */
+ public void initializePackageContents()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(superMainEClass, SuperMain.class, "SuperMain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getSuperMain_Name(), theEcorePackage.getEString(), "name", null, 0, 1, SuperMain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(anotherSuperMainEClass, AnotherSuperMain.class, "AnotherSuperMain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getAnotherSuperMain_Name(), theEcorePackage.getEString(), "name", null, 0, 1, AnotherSuperMain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //SuperPackagePackageImpl
diff --git a/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/util/SuperPackageAdapterFactory.java b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/util/SuperPackageAdapterFactory.java
new file mode 100644
index 000000000..af91c06b0
--- /dev/null
+++ b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/util/SuperPackageAdapterFactory.java
@@ -0,0 +1,153 @@
+/**
+ * generated by Xtext
+ */
+package org.eclipse.xtext.generator.ecore.superPackage.util;
+
+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;
+
+import org.eclipse.xtext.generator.ecore.superPackage.*;
+
+/**
+ *
+ * The Adapter Factory for the model.
+ * It provides an adapter createXXX
method for each class of the model.
+ *
+ * @see org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage
+ * @generated
+ */
+public class SubPackageAdapterFactory extends AdapterFactoryImpl
+{
+ /**
+ * The cached model package.
+ *
+ *
+ * @generated
+ */
+ protected static SubPackagePackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ *
+ *
+ * @generated
+ */
+ public SubPackageAdapterFactory()
+ {
+ if (modelPackage == null)
+ {
+ modelPackage = SubPackagePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ *
+ * This implementation returns true
if the object is either the model's package or is an instance object of the model.
+ *
+ * @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 createXXX
methods.
+ *
+ *
+ * @generated
+ */
+ protected SubPackageSwitchtarget
.
+ *
+ *
+ * @param target the object to adapt.
+ * @return the adapter for the target
.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target)
+ {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.xtext.generator.ecore.subPackage.SubMain Sub Main}'.
+ *
+ * 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.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.xtext.generator.ecore.subPackage.SubMain
+ * @generated
+ */
+ public Adapter createSubMainAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.xtext.generator.ecore.subPackage.AnotherSuperMain Another Super Main}'.
+ *
+ * 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.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.xtext.generator.ecore.subPackage.AnotherSuperMain
+ * @generated
+ */
+ public Adapter createAnotherSuperMainAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain Another Super Main}'.
+ *
+ * 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.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain
+ * @generated
+ */
+ public Adapter createSuperPackage_AnotherSuperMainAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ *
+ * This default implementation returns null.
+ *
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter()
+ {
+ return null;
+ }
+
+} //SubPackageAdapterFactory
diff --git a/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/subPackage/util/SubPackageSwitch.java b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/subPackage/util/SubPackageSwitch.java
new file mode 100644
index 000000000..174c71d2b
--- /dev/null
+++ b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/subPackage/util/SubPackageSwitch.java
@@ -0,0 +1,160 @@
+/**
+ * generated by Xtext
+ */
+package org.eclipse.xtext.generator.ecore.subPackage.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import org.eclipse.xtext.generator.ecore.subPackage.*;
+
+/**
+ *
+ * The Switch for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the caseXXX
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.
+ *
+ * @see org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage
+ * @generated
+ */
+public class SubPackageSwitchcaseXXX
for each class of the model until one returns a non null result; it yields that result.
+ *
+ *
+ * @return the first non-null result returned by a caseXXX
call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject)
+ {
+ switch (classifierID)
+ {
+ case SubPackagePackage.SUB_MAIN:
+ {
+ SubMain subMain = (SubMain)theEObject;
+ T result = caseSubMain(subMain);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case SubPackagePackage.ANOTHER_SUPER_MAIN:
+ {
+ AnotherSuperMain anotherSuperMain = (AnotherSuperMain)theEObject;
+ T result = caseAnotherSuperMain(anotherSuperMain);
+ if (result == null) result = caseSuperPackage_AnotherSuperMain(anotherSuperMain);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Sub Main'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Sub Main'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseSubMain(SubMain object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Another Super Main'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Another Super Main'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseAnotherSuperMain(AnotherSuperMain object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Another Super Main'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Another Super Main'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseSuperPackage_AnotherSuperMain(org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'EObject'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'EObject'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object)
+ {
+ return null;
+ }
+
+} //SubPackageSwitch
diff --git a/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/AnotherSuperMain.java b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/AnotherSuperMain.java
new file mode 100644
index 000000000..603e70e07
--- /dev/null
+++ b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/AnotherSuperMain.java
@@ -0,0 +1,52 @@
+/**
+ * generated by Xtext
+ */
+package org.eclipse.xtext.generator.ecore.superPackage;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ *
+ * A representation of the model object 'Another Super Main'.
+ *
+ *
+ *
+ *
+ *
+ * @see org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage#getAnotherSuperMain()
+ * @model
+ * @generated
+ */
+public interface AnotherSuperMain extends EObject
+{
+ /**
+ * Returns the value of the 'Name' attribute.
+ *
+ *
+ *
+ *
+ * @see org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage#getSuperMain()
+ * @model
+ * @generated
+ */
+public interface SuperMain extends EObject
+{
+ /**
+ * Returns the value of the 'Name' attribute.
+ *
+ *
+ *
+ *
+ * @see org.eclipse.xtext.generator.ecore.superPackage.SuperPackageFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface SuperPackagePackage extends EPackage
+{
+ /**
+ * The package name.
+ *
+ *
+ * @generated
+ */
+ String eNAME = "superPackage";
+
+ /**
+ * The package namespace URI.
+ *
+ *
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/2009/tmf/xtext/SuperTestLanguage";
+
+ /**
+ * The package namespace name.
+ *
+ *
+ * @generated
+ */
+ String eNS_PREFIX = "superPackage";
+
+ /**
+ * The singleton instance of the package.
+ *
+ *
+ * @generated
+ */
+ SuperPackagePackage eINSTANCE = org.eclipse.xtext.generator.ecore.superPackage.impl.SuperPackagePackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.xtext.generator.ecore.superPackage.impl.SuperMainImpl Super Main}' class.
+ *
+ *
+ * @see org.eclipse.xtext.generator.ecore.superPackage.impl.SuperMainImpl
+ * @see org.eclipse.xtext.generator.ecore.superPackage.impl.SuperPackagePackageImpl#getSuperMain()
+ * @generated
+ */
+ int SUPER_MAIN = 0;
+
+ /**
+ * The feature id for the 'Name' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int SUPER_MAIN__NAME = 0;
+
+ /**
+ * The number of structural features of the 'Super Main' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int SUPER_MAIN_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.xtext.generator.ecore.superPackage.impl.AnotherSuperMainImpl Another Super Main}' class.
+ *
+ *
+ * @see org.eclipse.xtext.generator.ecore.superPackage.impl.AnotherSuperMainImpl
+ * @see org.eclipse.xtext.generator.ecore.superPackage.impl.SuperPackagePackageImpl#getAnotherSuperMain()
+ * @generated
+ */
+ int ANOTHER_SUPER_MAIN = 1;
+
+ /**
+ * The feature id for the 'Name' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int ANOTHER_SUPER_MAIN__NAME = 0;
+
+ /**
+ * The number of structural features of the 'Another Super Main' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int ANOTHER_SUPER_MAIN_FEATURE_COUNT = 1;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.xtext.generator.ecore.superPackage.SuperMain Super Main}'.
+ *
+ *
+ * @return the meta object for class 'Super Main'.
+ * @see org.eclipse.xtext.generator.ecore.superPackage.SuperMain
+ * @generated
+ */
+ EClass getSuperMain();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.xtext.generator.ecore.superPackage.SuperMain#getName Name}'.
+ *
+ *
+ * @return the meta object for the attribute 'Name'.
+ * @see org.eclipse.xtext.generator.ecore.superPackage.SuperMain#getName()
+ * @see #getSuperMain()
+ * @generated
+ */
+ EAttribute getSuperMain_Name();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain Another Super Main}'.
+ *
+ *
+ * @return the meta object for class 'Another Super Main'.
+ * @see org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain
+ * @generated
+ */
+ EClass getAnotherSuperMain();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain#getName Name}'.
+ *
+ *
+ * @return the meta object for the attribute 'Name'.
+ * @see org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain#getName()
+ * @see #getAnotherSuperMain()
+ * @generated
+ */
+ EAttribute getAnotherSuperMain_Name();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ *
+ *
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ SuperPackageFactory getSuperPackageFactory();
+
+ /**
+ *
+ * Defines literals for the meta objects that represent
+ *
+ *
+ *
+ * @generated
+ */
+ interface Literals
+ {
+ /**
+ * The meta object literal for the '{@link org.eclipse.xtext.generator.ecore.superPackage.impl.SuperMainImpl Super Main}' class.
+ *
+ *
+ * @see org.eclipse.xtext.generator.ecore.superPackage.impl.SuperMainImpl
+ * @see org.eclipse.xtext.generator.ecore.superPackage.impl.SuperPackagePackageImpl#getSuperMain()
+ * @generated
+ */
+ EClass SUPER_MAIN = eINSTANCE.getSuperMain();
+
+ /**
+ * The meta object literal for the 'Name' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute SUPER_MAIN__NAME = eINSTANCE.getSuperMain_Name();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.xtext.generator.ecore.superPackage.impl.AnotherSuperMainImpl Another Super Main}' class.
+ *
+ *
+ * @see org.eclipse.xtext.generator.ecore.superPackage.impl.AnotherSuperMainImpl
+ * @see org.eclipse.xtext.generator.ecore.superPackage.impl.SuperPackagePackageImpl#getAnotherSuperMain()
+ * @generated
+ */
+ EClass ANOTHER_SUPER_MAIN = eINSTANCE.getAnotherSuperMain();
+
+ /**
+ * The meta object literal for the 'Name' attribute feature.
+ *
+ *
+ * @generated
+ */
+ EAttribute ANOTHER_SUPER_MAIN__NAME = eINSTANCE.getAnotherSuperMain_Name();
+
+ }
+
+} //SuperPackagePackage
diff --git a/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/impl/AnotherSuperMainImpl.java b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/impl/AnotherSuperMainImpl.java
new file mode 100644
index 000000000..1c90716a5
--- /dev/null
+++ b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/impl/AnotherSuperMainImpl.java
@@ -0,0 +1,178 @@
+/**
+ * generated by Xtext
+ */
+package org.eclipse.xtext.generator.ecore.superPackage.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.MinimalEObjectImpl;
+
+import org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain;
+import org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage;
+
+/**
+ *
+ * An implementation of the model object 'Another Super Main'.
+ *
+ *
+ *
+ *
+ * @generated
+ */
+public class AnotherSuperMainImpl extends MinimalEObjectImpl.Container implements AnotherSuperMain
+{
+ /**
+ * The default value of the '{@link #getName() Name}' attribute.
+ *
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() Name}' attribute.
+ *
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected AnotherSuperMainImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return SuperPackagePackage.Literals.ANOTHER_SUPER_MAIN;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SuperPackagePackage.ANOTHER_SUPER_MAIN__NAME, oldName, name));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case SuperPackagePackage.ANOTHER_SUPER_MAIN__NAME:
+ return getName();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case SuperPackagePackage.ANOTHER_SUPER_MAIN__NAME:
+ setName((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case SuperPackagePackage.ANOTHER_SUPER_MAIN__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case SuperPackagePackage.ANOTHER_SUPER_MAIN__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @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();
+ }
+
+} //AnotherSuperMainImpl
diff --git a/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/impl/SuperMainImpl.java b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/impl/SuperMainImpl.java
new file mode 100644
index 000000000..9c7722cc9
--- /dev/null
+++ b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/impl/SuperMainImpl.java
@@ -0,0 +1,178 @@
+/**
+ * generated by Xtext
+ */
+package org.eclipse.xtext.generator.ecore.superPackage.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.MinimalEObjectImpl;
+
+import org.eclipse.xtext.generator.ecore.superPackage.SuperMain;
+import org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage;
+
+/**
+ *
+ * An implementation of the model object 'Super Main'.
+ *
+ *
+ *
+ *
+ * @generated
+ */
+public class SuperMainImpl extends MinimalEObjectImpl.Container implements SuperMain
+{
+ /**
+ * The default value of the '{@link #getName() Name}' attribute.
+ *
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() Name}' attribute.
+ *
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ protected SuperMainImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return SuperPackagePackage.Literals.SUPER_MAIN;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SuperPackagePackage.SUPER_MAIN__NAME, oldName, name));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case SuperPackagePackage.SUPER_MAIN__NAME:
+ return getName();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case SuperPackagePackage.SUPER_MAIN__NAME:
+ setName((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case SuperPackagePackage.SUPER_MAIN__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case SuperPackagePackage.SUPER_MAIN__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ *
+ *
+ * @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();
+ }
+
+} //SuperMainImpl
diff --git a/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/impl/SuperPackageFactoryImpl.java b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/impl/SuperPackageFactoryImpl.java
new file mode 100644
index 000000000..002143ee1
--- /dev/null
+++ b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/impl/SuperPackageFactoryImpl.java
@@ -0,0 +1,119 @@
+/**
+ * generated by Xtext
+ */
+package org.eclipse.xtext.generator.ecore.superPackage.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.eclipse.xtext.generator.ecore.superPackage.*;
+
+/**
+ *
+ * An implementation of the model Factory.
+ *
+ * @generated
+ */
+public class SuperPackageFactoryImpl extends EFactoryImpl implements SuperPackageFactory
+{
+ /**
+ * Creates the default factory implementation.
+ *
+ *
+ * @generated
+ */
+ public static SuperPackageFactory init()
+ {
+ try
+ {
+ SuperPackageFactory theSuperPackageFactory = (SuperPackageFactory)EPackage.Registry.INSTANCE.getEFactory(SuperPackagePackage.eNS_URI);
+ if (theSuperPackageFactory != null)
+ {
+ return theSuperPackageFactory;
+ }
+ }
+ catch (Exception exception)
+ {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new SuperPackageFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ *
+ *
+ * @generated
+ */
+ public SuperPackageFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass)
+ {
+ switch (eClass.getClassifierID())
+ {
+ case SuperPackagePackage.SUPER_MAIN: return createSuperMain();
+ case SuperPackagePackage.ANOTHER_SUPER_MAIN: return createAnotherSuperMain();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public SuperMain createSuperMain()
+ {
+ SuperMainImpl superMain = new SuperMainImpl();
+ return superMain;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public AnotherSuperMain createAnotherSuperMain()
+ {
+ AnotherSuperMainImpl anotherSuperMain = new AnotherSuperMainImpl();
+ return anotherSuperMain;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public SuperPackagePackage getSuperPackagePackage()
+ {
+ return (SuperPackagePackage)getEPackage();
+ }
+
+ /**
+ *
+ *
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static SuperPackagePackage getPackage()
+ {
+ return SuperPackagePackage.eINSTANCE;
+ }
+
+} //SuperPackageFactoryImpl
diff --git a/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/impl/SuperPackagePackageImpl.java b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/impl/SuperPackagePackageImpl.java
new file mode 100644
index 000000000..7b3c23783
--- /dev/null
+++ b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/impl/SuperPackagePackageImpl.java
@@ -0,0 +1,227 @@
+/**
+ * generated by Xtext
+ */
+package org.eclipse.xtext.generator.ecore.superPackage.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcorePackage;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain;
+import org.eclipse.xtext.generator.ecore.superPackage.SuperMain;
+import org.eclipse.xtext.generator.ecore.superPackage.SuperPackageFactory;
+import org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage;
+
+/**
+ *
+ * An implementation of the model Package.
+ *
+ * @generated
+ */
+public class SuperPackagePackageImpl extends EPackageImpl implements SuperPackagePackage
+{
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass superMainEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass anotherSuperMainEClass = null;
+
+ /**
+ * Creates an instance of the model Package, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * createXXX
method for each class of the model.
+ *
+ * @see org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage
+ * @generated
+ */
+public class SuperPackageAdapterFactory extends AdapterFactoryImpl
+{
+ /**
+ * The cached model package.
+ *
+ *
+ * @generated
+ */
+ protected static SuperPackagePackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ *
+ *
+ * @generated
+ */
+ public SuperPackageAdapterFactory()
+ {
+ if (modelPackage == null)
+ {
+ modelPackage = SuperPackagePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ *
+ * This implementation returns true
if the object is either the model's package or is an instance object of the model.
+ *
+ * @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 createXXX
methods.
+ *
+ *
+ * @generated
+ */
+ protected SuperPackageSwitchtarget
.
+ *
+ *
+ * @param target the object to adapt.
+ * @return the adapter for the target
.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target)
+ {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.xtext.generator.ecore.superPackage.SuperMain Super Main}'.
+ *
+ * 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.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.xtext.generator.ecore.superPackage.SuperMain
+ * @generated
+ */
+ public Adapter createSuperMainAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain Another Super Main}'.
+ *
+ * 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.
+ *
+ * @return the new adapter.
+ * @see org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain
+ * @generated
+ */
+ public Adapter createAnotherSuperMainAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ *
+ * This default implementation returns null.
+ *
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter()
+ {
+ return null;
+ }
+
+} //SuperPackageAdapterFactory
diff --git a/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/util/SuperPackageSwitch.java b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/util/SuperPackageSwitch.java
new file mode 100644
index 000000000..fd37e29e6
--- /dev/null
+++ b/tests/org.eclipse.xtext.tests/src-gen2/org/eclipse/xtext/generator/ecore/superPackage/util/SuperPackageSwitch.java
@@ -0,0 +1,143 @@
+/**
+ * generated by Xtext
+ */
+package org.eclipse.xtext.generator.ecore.superPackage.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import org.eclipse.xtext.generator.ecore.superPackage.*;
+
+/**
+ *
+ * The Switch for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the caseXXX
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.
+ *
+ * @see org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage
+ * @generated
+ */
+public class SuperPackageSwitchcaseXXX
for each class of the model until one returns a non null result; it yields that result.
+ *
+ *
+ * @return the first non-null result returned by a caseXXX
call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject)
+ {
+ switch (classifierID)
+ {
+ case SuperPackagePackage.SUPER_MAIN:
+ {
+ SuperMain superMain = (SuperMain)theEObject;
+ T result = caseSuperMain(superMain);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case SuperPackagePackage.ANOTHER_SUPER_MAIN:
+ {
+ AnotherSuperMain anotherSuperMain = (AnotherSuperMain)theEObject;
+ T result = caseAnotherSuperMain(anotherSuperMain);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Super Main'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Super Main'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseSuperMain(SuperMain object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Another Super Main'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Another Super Main'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseAnotherSuperMain(AnotherSuperMain object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'EObject'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'EObject'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object)
+ {
+ return null;
+ }
+
+} //SuperPackageSwitch
diff --git a/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/GenerateAllTestLanguages.mwe2 b/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/GenerateAllTestLanguages.mwe2
index fe6fb0325..cf68a8e2e 100644
--- a/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/GenerateAllTestLanguages.mwe2
+++ b/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/GenerateAllTestLanguages.mwe2
@@ -66,16 +66,16 @@ Workflow {
pathTestProject = runtimeProject
projectNameRt = projectName
- language = {
- uri = "classpath:/org/eclipse/xtext/generator/ecore/SuperTestLanguage.xtext"
- fragment = @TestLanguagesFragments {
- srcGenOnly = false
- }
- }
- language = {
- uri = "classpath:/org/eclipse/xtext/generator/ecore/SubTestLanguage.xtext"
- fragment = @TestLanguagesFragments {}
- }
+// language = {
+// uri = "classpath:/org/eclipse/xtext/generator/ecore/SuperTestLanguage.xtext"
+// fragment = @TestLanguagesFragments {
+// srcGenOnly = false
+// }
+// }
+// language = {
+// uri = "classpath:/org/eclipse/xtext/generator/ecore/SubTestLanguage.xtext"
+// fragment = @TestLanguagesFragments {}
+// }
language = {
uri = "classpath:/org/eclipse/xtext/XtextGrammarTestLanguage.xtext"
fragment = @TestLanguagesFragments {}
diff --git a/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/GenerateAllTestLanguages2.mwe2 b/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/GenerateAllTestLanguages2.mwe2
index fd9151e82..ffda922f4 100644
--- a/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/GenerateAllTestLanguages2.mwe2
+++ b/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/GenerateAllTestLanguages2.mwe2
@@ -89,9 +89,15 @@ Workflow {
}
language = TestLanguage {
name = "org.eclipse.xtext.generator.ecore.SuperTestLanguage"
+ ideaPlugin = {
+ generateXtendStub = true
+ }
}
language = TestLanguage {
name = "org.eclipse.xtext.generator.ecore.SubTestLanguage"
+ ideaPlugin = {
+ generateXtendStub = true
+ }
}
// language = TestLanguage {
// name = "org.eclipse.xtext.XtextGrammarTestLanguage"
diff --git a/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/generator/ecore/serializer/SuperTestLanguageSemanticSequencer.java b/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/generator/ecore/serializer/SuperTestLanguageSemanticSequencer.java
deleted file mode 100644
index 1d82c8baf..000000000
--- a/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/generator/ecore/serializer/SuperTestLanguageSemanticSequencer.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package org.eclipse.xtext.generator.ecore.serializer;
-
-public class SuperTestLanguageSemanticSequencer extends AbstractSuperTestLanguageSemanticSequencer {
-}
diff --git a/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/generator/ecore/serializer/SuperTestLanguageSyntacticSequencer.java b/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/generator/ecore/serializer/SuperTestLanguageSyntacticSequencer.java
deleted file mode 100644
index f3e28bc32..000000000
--- a/tests/org.eclipse.xtext.tests/src/org/eclipse/xtext/generator/ecore/serializer/SuperTestLanguageSyntacticSequencer.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package org.eclipse.xtext.generator.ecore.serializer;
-
-public class SuperTestLanguageSyntacticSequencer extends AbstractSuperTestLanguageSyntacticSequencer {
-}