diff options
author | khussey | 2011-01-27 21:38:58 +0000 |
---|---|---|
committer | khussey | 2011-01-27 21:38:58 +0000 |
commit | 8e7c65ad1b0e5ecfb4be37bcae384d5df4b3b1d5 (patch) | |
tree | fb1a66260a15ede16dc5f2d33f6dfcb15e3d52d1 /plugins | |
parent | 15ff10df1912f6ff2b4b0f0578858c27fe622d97 (diff) | |
download | org.eclipse.uml2-8e7c65ad1b0e5ecfb4be37bcae384d5df4b3b1d5.tar.gz org.eclipse.uml2-8e7c65ad1b0e5ecfb4be37bcae384d5df4b3b1d5.tar.xz org.eclipse.uml2-8e7c65ad1b0e5ecfb4be37bcae384d5df4b3b1d5.zip |
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/org.eclipse.uml2.codegen.ecore/META-INF/MANIFEST.MF | 2 | ||||
-rw-r--r-- | plugins/org.eclipse.uml2.codegen.ecore/src/org/eclipse/uml2/codegen/ecore/genmodel/util/GenModelSwitch.java | 43 |
2 files changed, 16 insertions, 29 deletions
diff --git a/plugins/org.eclipse.uml2.codegen.ecore/META-INF/MANIFEST.MF b/plugins/org.eclipse.uml2.codegen.ecore/META-INF/MANIFEST.MF index dfdb2bc9f..db785524d 100644 --- a/plugins/org.eclipse.uml2.codegen.ecore/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.uml2.codegen.ecore/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.uml2.codegen.ecore; singleton:=true -Bundle-Version: 1.6.100.qualifier +Bundle-Version: 1.7.0.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.uml2.codegen.ecore.CodeGenEcorePlugin$Implementation Bundle-Vendor: %providerName diff --git a/plugins/org.eclipse.uml2.codegen.ecore/src/org/eclipse/uml2/codegen/ecore/genmodel/util/GenModelSwitch.java b/plugins/org.eclipse.uml2.codegen.ecore/src/org/eclipse/uml2/codegen/ecore/genmodel/util/GenModelSwitch.java index d386263e3..97f3e1eb7 100644 --- a/plugins/org.eclipse.uml2.codegen.ecore/src/org/eclipse/uml2/codegen/ecore/genmodel/util/GenModelSwitch.java +++ b/plugins/org.eclipse.uml2.codegen.ecore/src/org/eclipse/uml2/codegen/ecore/genmodel/util/GenModelSwitch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008 IBM Corporation, Embarcadero Technologies, and others. + * Copyright (c) 2005, 2011 IBM Corporation, Embarcadero Technologies, 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 @@ -8,16 +8,16 @@ * Contributors: * IBM - initial API and implementation * Kenn Hussey (Embarcadero Technologies) - 247980 + * Kenn Hussey - 323181 * - * $Id: GenModelSwitch.java,v 1.7 2008/12/16 15:52:48 khussey Exp $ + * $Id: GenModelSwitch.java,v 1.8 2011/01/27 21:38:58 khussey Exp $ */ package org.eclipse.uml2.codegen.ecore.genmodel.util; -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.uml2.codegen.ecore.genmodel.*; /** @@ -33,7 +33,8 @@ import org.eclipse.uml2.codegen.ecore.genmodel.*; * @see org.eclipse.uml2.codegen.ecore.genmodel.GenModelPackage * @generated */ -public class GenModelSwitch<T> { +public class GenModelSwitch<T> + extends Switch<T> { /** * The cached model package @@ -56,32 +57,16 @@ public class GenModelSwitch<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; } /** @@ -91,6 +76,7 @@ public class GenModelSwitch<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 GenModelPackage.GEN_BASE : { @@ -661,6 +647,7 @@ public class GenModelSwitch<T> { * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ + @Override public T defaultCase(EObject object) { return null; } |