/** * <copyright> * </copyright> * * $Id$ */ package orgomg.cwm.foundation.softwaredeployment.util; import java.util.List; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import orgomg.cwm.foundation.businessinformation.Location; import orgomg.cwm.foundation.softwaredeployment.*; import orgomg.cwm.objectmodel.core.Classifier; import orgomg.cwm.objectmodel.core.Dependency; import orgomg.cwm.objectmodel.core.Element; import orgomg.cwm.objectmodel.core.ModelElement; import orgomg.cwm.objectmodel.core.Namespace; import orgomg.cwm.objectmodel.core.Subsystem; /** * <!-- 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 orgomg.cwm.foundation.softwaredeployment.SoftwaredeploymentPackage * @generated */ public class SoftwaredeploymentSwitch<T> { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static SoftwaredeploymentPackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SoftwaredeploymentSwitch() { if (modelPackage == null) { modelPackage = SoftwaredeploymentPackage.eINSTANCE; } } /** * 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 */ 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 */ protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case SoftwaredeploymentPackage.SITE: { Site site = (Site)theEObject; T result = caseSite(site); if (result == null) result = caseLocation(site); if (result == null) result = caseModelElement(site); if (result == null) result = caseElement(site); if (result == null) result = defaultCase(theEObject); return result; } case SoftwaredeploymentPackage.MACHINE: { Machine machine = (Machine)theEObject; T result = caseMachine(machine); if (result == null) result = caseNamespace(machine); if (result == null) result = caseModelElement(machine); if (result == null) result = caseElement(machine); if (result == null) result = defaultCase(theEObject); return result; } case SoftwaredeploymentPackage.SOFTWARE_SYSTEM: { SoftwareSystem softwareSystem = (SoftwareSystem)theEObject; T result = caseSoftwareSystem(softwareSystem); if (result == null) result = caseSubsystem(softwareSystem); if (result == null) result = caseClassifier(softwareSystem); if (result == null) result = casePackage(softwareSystem); if (result == null) result = caseNamespace(softwareSystem); if (result == null) result = caseModelElement(softwareSystem); if (result == null) result = caseElement(softwareSystem); if (result == null) result = defaultCase(theEObject); return result; } case SoftwaredeploymentPackage.DEPLOYED_COMPONENT: { DeployedComponent deployedComponent = (DeployedComponent)theEObject; T result = caseDeployedComponent(deployedComponent); if (result == null) result = casePackage(deployedComponent); if (result == null) result = caseNamespace(deployedComponent); if (result == null) result = caseModelElement(deployedComponent); if (result == null) result = caseElement(deployedComponent); if (result == null) result = defaultCase(theEObject); return result; } case SoftwaredeploymentPackage.DEPLOYED_SOFTWARE_SYSTEM: { DeployedSoftwareSystem deployedSoftwareSystem = (DeployedSoftwareSystem)theEObject; T result = caseDeployedSoftwareSystem(deployedSoftwareSystem); if (result == null) result = casePackage(deployedSoftwareSystem); if (result == null) result = caseNamespace(deployedSoftwareSystem); if (result == null) result = caseModelElement(deployedSoftwareSystem); if (result == null) result = caseElement(deployedSoftwareSystem); if (result == null) result = defaultCase(theEObject); return result; } case SoftwaredeploymentPackage.DATA_MANAGER: { DataManager dataManager = (DataManager)theEObject; T result = caseDataManager(dataManager); if (result == null) result = caseDeployedComponent(dataManager); if (result == null) result = casePackage(dataManager); if (result == null) result = caseNamespace(dataManager); if (result == null) result = caseModelElement(dataManager); if (result == null) result = caseElement(dataManager); if (result == null) result = defaultCase(theEObject); return result; } case SoftwaredeploymentPackage.DATA_PROVIDER: { DataProvider dataProvider = (DataProvider)theEObject; T result = caseDataProvider(dataProvider); if (result == null) result = caseDataManager(dataProvider); if (result == null) result = caseDeployedComponent(dataProvider); if (result == null) result = casePackage(dataProvider); if (result == null) result = caseNamespace(dataProvider); if (result == null) result = caseModelElement(dataProvider); if (result == null) result = caseElement(dataProvider); if (result == null) result = defaultCase(theEObject); return result; } case SoftwaredeploymentPackage.PROVIDER_CONNECTION: { ProviderConnection providerConnection = (ProviderConnection)theEObject; T result = caseProviderConnection(providerConnection); if (result == null) result = caseModelElement(providerConnection); if (result == null) result = caseElement(providerConnection); if (result == null) result = defaultCase(theEObject); return result; } case SoftwaredeploymentPackage.COMPONENT: { Component component = (Component)theEObject; T result = caseComponent(component); if (result == null) result = caseClassifier(component); if (result == null) result = caseNamespace(component); if (result == null) result = caseModelElement(component); if (result == null) result = caseElement(component); if (result == null) result = defaultCase(theEObject); return result; } case SoftwaredeploymentPackage.PACKAGE_USAGE: { PackageUsage packageUsage = (PackageUsage)theEObject; T result = casePackageUsage(packageUsage); if (result == null) result = caseDependency(packageUsage); if (result == null) result = caseModelElement(packageUsage); if (result == null) result = caseElement(packageUsage); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * Returns the result of interpreting the object as an instance of '<em>Site</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>Site</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseSite(Site object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Machine</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>Machine</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseMachine(Machine object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Software System</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>Software System</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseSoftwareSystem(SoftwareSystem object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Deployed Component</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>Deployed Component</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDeployedComponent(DeployedComponent object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Deployed Software System</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>Deployed Software System</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDeployedSoftwareSystem(DeployedSoftwareSystem object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Data Manager</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>Data Manager</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDataManager(DataManager object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Data Provider</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>Data Provider</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDataProvider(DataProvider object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Provider Connection</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>Provider Connection</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseProviderConnection(ProviderConnection object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Component</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>Component</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseComponent(Component object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Package Usage</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>Package Usage</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePackageUsage(PackageUsage object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Element</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>Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseElement(Element object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Model Element</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>Model Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseModelElement(ModelElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Location</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>Location</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseLocation(Location object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Namespace</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>Namespace</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseNamespace(Namespace object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Classifier</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>Classifier</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseClassifier(Classifier object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Package</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>Package</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePackage(orgomg.cwm.objectmodel.core.Package object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Subsystem</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>Subsystem</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseSubsystem(Subsystem object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Dependency</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>Dependency</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDependency(Dependency 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 */ public T defaultCase(EObject object) { return null; } } //SoftwaredeploymentSwitch