Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorytanguy2011-07-18 11:40:46 +0000
committerytanguy2011-07-18 11:40:46 +0000
commitd7275e00cb209108e3614b36704cc9d72bf0cba4 (patch)
tree8668b77c59119193b5663e0197741c55abcded9f /plugins
parent8b5ded59525502a130f28b26ce4cb493d43df4de (diff)
downloadorg.eclipse.papyrus-d7275e00cb209108e3614b36704cc9d72bf0cba4.tar.gz
org.eclipse.papyrus-d7275e00cb209108e3614b36704cc9d72bf0cba4.tar.xz
org.eclipse.papyrus-d7275e00cb209108e3614b36704cc9d72bf0cba4.zip
NEW - bug 352334: [SysML Static Profile] A part of the API has not been generated (EPackageSwitch classes)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=352334
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/activities/util/ActivitiesSwitch.java50
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/allocations/util/AllocationsSwitch.java50
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/blocks/util/BlocksSwitch.java50
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/constraints/util/ConstraintsSwitch.java50
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/modelelements/util/ModelelementsSwitch.java50
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/portandflows/util/PortandflowsSwitch.java50
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/requirements/util/RequirementsSwitch.java50
7 files changed, 133 insertions, 217 deletions
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/activities/util/ActivitiesSwitch.java b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/activities/util/ActivitiesSwitch.java
index 538b8a85203..135d984c5cf 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/activities/util/ActivitiesSwitch.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/activities/util/ActivitiesSwitch.java
@@ -13,10 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.sysml.activities.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.papyrus.sysml.activities.ActivitiesPackage;
import org.eclipse.papyrus.sysml.activities.Continuous;
import org.eclipse.papyrus.sysml.activities.ControlOperator;
@@ -37,7 +36,7 @@ import org.eclipse.papyrus.sysml.activities.Rate;
* @see org.eclipse.papyrus.sysml.activities.ActivitiesPackage
* @generated
*/
-public class ActivitiesSwitch<T> {
+public class ActivitiesSwitch<T> extends Switch<T> {
/**
* The cached model package
@@ -60,6 +59,20 @@ public class ActivitiesSwitch<T> {
}
/**
+ * 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;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Continuous</em>'. <!--
* begin-user-doc --> This implementation returns null; returning a non-null result will
* terminate the switch. <!-- end-user-doc -->
@@ -175,6 +188,7 @@ public class ActivitiesSwitch<T> {
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
+ @Override
public T defaultCase(EObject object) {
return null;
}
@@ -186,33 +200,7 @@ public class ActivitiesSwitch<T> {
* @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);
- }
- }
-
- /**
- * 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 -->
- *
- * @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 ActivitiesPackage.OPTIONAL:
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/allocations/util/AllocationsSwitch.java b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/allocations/util/AllocationsSwitch.java
index ebd1cb354eb..c705cebbf91 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/allocations/util/AllocationsSwitch.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/allocations/util/AllocationsSwitch.java
@@ -13,10 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.sysml.allocations.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.papyrus.sysml.allocations.Allocate;
import org.eclipse.papyrus.sysml.allocations.AllocateActivityPartition;
import org.eclipse.papyrus.sysml.allocations.Allocated;
@@ -32,7 +31,7 @@ import org.eclipse.papyrus.sysml.allocations.AllocationsPackage;
* @see org.eclipse.papyrus.sysml.allocations.AllocationsPackage
* @generated
*/
-public class AllocationsSwitch<T> {
+public class AllocationsSwitch<T> extends Switch<T> {
/**
* The cached model package
@@ -55,6 +54,20 @@ public class AllocationsSwitch<T> {
}
/**
+ * 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;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Allocate</em>'. <!--
* begin-user-doc --> This implementation returns null; returning a non-null result will
* terminate the switch. <!-- end-user-doc -->
@@ -111,6 +124,7 @@ public class AllocationsSwitch<T> {
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
+ @Override
public T defaultCase(EObject object) {
return null;
}
@@ -122,33 +136,7 @@ public class AllocationsSwitch<T> {
* @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);
- }
- }
-
- /**
- * 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 -->
- *
- * @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 AllocationsPackage.ALLOCATE:
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/blocks/util/BlocksSwitch.java b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/blocks/util/BlocksSwitch.java
index 68d24bf39e4..34f4dd4ba09 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/blocks/util/BlocksSwitch.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/blocks/util/BlocksSwitch.java
@@ -13,10 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.sysml.blocks.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.papyrus.sysml.blocks.BindingConnector;
import org.eclipse.papyrus.sysml.blocks.Block;
import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
@@ -39,7 +38,7 @@ import org.eclipse.papyrus.sysml.blocks.ValueType;
* @see org.eclipse.papyrus.sysml.blocks.BlocksPackage
* @generated
*/
-public class BlocksSwitch<T> {
+public class BlocksSwitch<T> extends Switch<T> {
/**
* The cached model package
@@ -62,6 +61,20 @@ public class BlocksSwitch<T> {
}
/**
+ * 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;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Binding Connector</em>'.
* <!-- begin-user-doc --> This implementation returns null; returning a non-null result will
* terminate the switch. <!-- end-user-doc -->
@@ -227,6 +240,7 @@ public class BlocksSwitch<T> {
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
+ @Override
public T defaultCase(EObject object) {
return null;
}
@@ -238,33 +252,7 @@ public class BlocksSwitch<T> {
* @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);
- }
- }
-
- /**
- * 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 -->
- *
- * @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 BlocksPackage.BLOCK:
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/constraints/util/ConstraintsSwitch.java b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/constraints/util/ConstraintsSwitch.java
index 4adc9d10ded..219149085f6 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/constraints/util/ConstraintsSwitch.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/constraints/util/ConstraintsSwitch.java
@@ -13,10 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.sysml.constraints.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.papyrus.sysml.blocks.Block;
import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
@@ -32,7 +31,7 @@ import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage;
* @see org.eclipse.papyrus.sysml.constraints.ConstraintsPackage
* @generated
*/
-public class ConstraintsSwitch<T> {
+public class ConstraintsSwitch<T> extends Switch<T> {
/**
* The cached model package
@@ -55,6 +54,20 @@ public class ConstraintsSwitch<T> {
}
/**
+ * 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;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Block</em>'. <!--
* begin-user-doc --> This implementation returns null; returning a non-null result will
* terminate the switch. <!-- end-user-doc -->
@@ -111,6 +124,7 @@ public class ConstraintsSwitch<T> {
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
+ @Override
public T defaultCase(EObject object) {
return null;
}
@@ -122,33 +136,7 @@ public class ConstraintsSwitch<T> {
* @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);
- }
- }
-
- /**
- * 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 -->
- *
- * @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 ConstraintsPackage.CONSTRAINT_BLOCK:
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/modelelements/util/ModelelementsSwitch.java b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/modelelements/util/ModelelementsSwitch.java
index f2a8511abd1..e3220c99e1f 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/modelelements/util/ModelelementsSwitch.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/modelelements/util/ModelelementsSwitch.java
@@ -13,10 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.sysml.modelelements.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.papyrus.sysml.modelelements.Conform;
import org.eclipse.papyrus.sysml.modelelements.ModelelementsPackage;
import org.eclipse.papyrus.sysml.modelelements.Problem;
@@ -34,7 +33,7 @@ import org.eclipse.papyrus.sysml.modelelements.ViewPoint;
* @see org.eclipse.papyrus.sysml.modelelements.ModelelementsPackage
* @generated
*/
-public class ModelelementsSwitch<T> {
+public class ModelelementsSwitch<T> extends Switch<T> {
/**
* The cached model package
@@ -57,6 +56,20 @@ public class ModelelementsSwitch<T> {
}
/**
+ * 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;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Conform</em>'. <!--
* begin-user-doc --> This implementation returns null; returning a non-null result will
* terminate the switch. <!-- end-user-doc -->
@@ -142,6 +155,7 @@ public class ModelelementsSwitch<T> {
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
+ @Override
public T defaultCase(EObject object) {
return null;
}
@@ -153,33 +167,7 @@ public class ModelelementsSwitch<T> {
* @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);
- }
- }
-
- /**
- * 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 -->
- *
- * @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 ModelelementsPackage.CONFORM:
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/portandflows/util/PortandflowsSwitch.java b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/portandflows/util/PortandflowsSwitch.java
index 2b511fb5aff..949ad405700 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/portandflows/util/PortandflowsSwitch.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/portandflows/util/PortandflowsSwitch.java
@@ -13,10 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.sysml.portandflows.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.papyrus.sysml.portandflows.FlowPort;
import org.eclipse.papyrus.sysml.portandflows.FlowProperty;
import org.eclipse.papyrus.sysml.portandflows.FlowSpecification;
@@ -33,7 +32,7 @@ import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
* @see org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage
* @generated
*/
-public class PortandflowsSwitch<T> {
+public class PortandflowsSwitch<T> extends Switch<T> {
/**
* The cached model package
@@ -56,6 +55,20 @@ public class PortandflowsSwitch<T> {
}
/**
+ * 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;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Flow Port</em>'. <!--
* begin-user-doc --> This implementation returns null; returning a non-null result will
* terminate the switch. <!-- end-user-doc -->
@@ -127,6 +140,7 @@ public class PortandflowsSwitch<T> {
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
+ @Override
public T defaultCase(EObject object) {
return null;
}
@@ -138,33 +152,7 @@ public class PortandflowsSwitch<T> {
* @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);
- }
- }
-
- /**
- * 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 -->
- *
- * @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 PortandflowsPackage.FLOW_PORT:
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/requirements/util/RequirementsSwitch.java b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/requirements/util/RequirementsSwitch.java
index ed7bff18e1d..954064b5858 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/requirements/util/RequirementsSwitch.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml/src/org/eclipse/papyrus/sysml/requirements/util/RequirementsSwitch.java
@@ -13,10 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.sysml.requirements.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.papyrus.sysml.requirements.Copy;
import org.eclipse.papyrus.sysml.requirements.DeriveReqt;
import org.eclipse.papyrus.sysml.requirements.Requirement;
@@ -37,7 +36,7 @@ import org.eclipse.papyrus.uml.standard.Trace;
* @see org.eclipse.papyrus.sysml.requirements.RequirementsPackage
* @generated
*/
-public class RequirementsSwitch<T> {
+public class RequirementsSwitch<T> extends Switch<T> {
/**
* The cached model package
@@ -60,6 +59,20 @@ public class RequirementsSwitch<T> {
}
/**
+ * 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;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Copy</em>'. <!--
* begin-user-doc --> This implementation returns null; returning a non-null result will
* terminate the switch. <!-- end-user-doc -->
@@ -191,6 +204,7 @@ public class RequirementsSwitch<T> {
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
+ @Override
public T defaultCase(EObject object) {
return null;
}
@@ -202,33 +216,7 @@ public class RequirementsSwitch<T> {
* @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);
- }
- }
-
- /**
- * 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 -->
- *
- * @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 RequirementsPackage.DERIVE_REQT:

Back to the top