diff options
Diffstat (limited to 'tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalSwitch.java')
-rwxr-xr-x | tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalSwitch.java | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalSwitch.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalSwitch.java index 204149014..54008357c 100755 --- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalSwitch.java +++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/external/util/ExternalSwitch.java @@ -10,6 +10,9 @@ import java.util.List; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.Switch; +import org.eclipse.emf.teneo.samples.emf.annotations.external.*; import org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalObject; import org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalPackage; import org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalTest; @@ -27,7 +30,7 @@ import org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalTest; * @see org.eclipse.emf.teneo.samples.emf.annotations.external.ExternalPackage * @generated */ -public class ExternalSwitch<T> { +public class ExternalSwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> @@ -49,34 +52,16 @@ public class ExternalSwitch<T> { } /** - * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * Checks whether this is a switch for the given package. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @return the first non-null result returned by a <code>caseXXX</code> call. + * @parameter ePackage the package in question. + * @return whether this is a switch for the given package. * @generated */ - 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 --> - * @return the first non-null result returned by a <code>caseXXX</code> call. - * @generated - */ - protected T doSwitch(EClass theEClass, EObject theEObject) { - if (theEClass.eContainer() == modelPackage) { - return doSwitch(theEClass.getClassifierID(), theEObject); - } - else { - List<EClass> eSuperTypes = theEClass.getESuperTypes(); - return - eSuperTypes.isEmpty() ? - defaultCase(theEObject) : - doSwitch(eSuperTypes.get(0), theEObject); - } + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; } /** @@ -86,6 +71,7 @@ public class ExternalSwitch<T> { * @return the first non-null result returned by a <code>caseXXX</code> call. * @generated */ + @Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case ExternalPackage.EXTERNAL_TEST: { @@ -145,6 +131,7 @@ public class ExternalSwitch<T> { * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ + @Override public T defaultCase(EObject object) { return null; } |