| /** |
| * <copyright> |
| * </copyright> |
| * |
| * $Id: ModuleCoreSwitch.java,v 1.6 2005/01/26 16:48:35 cbridgha Exp $ |
| */ |
| package org.eclipse.wst.common.modulecore.util; |
| |
| import java.util.List; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.wst.common.modulecore.DeployScheme; |
| import org.eclipse.wst.common.modulecore.DeployedModule; |
| import org.eclipse.wst.common.modulecore.IModuleType; |
| import org.eclipse.wst.common.modulecore.ModuleCorePackage; |
| import org.eclipse.wst.common.modulecore.ProjectModules; |
| import org.eclipse.wst.common.modulecore.WorkbenchApplication; |
| import org.eclipse.wst.common.modulecore.WorkbenchModule; |
| import org.eclipse.wst.common.modulecore.WorkbenchModuleResource; |
| |
| /** |
| * <!-- 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 org.eclipse.wst.common.modulecore.ModuleCorePackage |
| * @generated |
| */ |
| public class ModuleCoreSwitch { |
| /** |
| * The cached model package |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected static ModuleCorePackage modelPackage; |
| |
| /** |
| * Creates an instance of the switch. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ModuleCoreSwitch() { |
| if (modelPackage == null) { |
| modelPackage = ModuleCorePackage.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 Object 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 Object doSwitch(EClass theEClass, EObject theEObject) { |
| if (theEClass.eContainer() == modelPackage) { |
| return doSwitch(theEClass.getClassifierID(), theEObject); |
| } |
| else { |
| List eSuperTypes = theEClass.getESuperTypes(); |
| return |
| eSuperTypes.isEmpty() ? |
| defaultCase(theEObject) : |
| doSwitch((EClass)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 Object doSwitch(int classifierID, EObject theEObject) { |
| switch (classifierID) { |
| case ModuleCorePackage.DEPLOY_SCHEME: { |
| DeployScheme deployScheme = (DeployScheme)theEObject; |
| Object result = caseDeployScheme(deployScheme); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case ModuleCorePackage.WORKBENCH_MODULE: { |
| WorkbenchModule workbenchModule = (WorkbenchModule)theEObject; |
| Object result = caseWorkbenchModule(workbenchModule); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case ModuleCorePackage.WORKBENCH_MODULE_RESOURCE: { |
| WorkbenchModuleResource workbenchModuleResource = (WorkbenchModuleResource)theEObject; |
| Object result = caseWorkbenchModuleResource(workbenchModuleResource); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case ModuleCorePackage.WORKBENCH_APPLICATION: { |
| WorkbenchApplication workbenchApplication = (WorkbenchApplication)theEObject; |
| Object result = caseWorkbenchApplication(workbenchApplication); |
| if (result == null) result = caseWorkbenchModule(workbenchApplication); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case ModuleCorePackage.IMODULE_TYPE: { |
| IModuleType iModuleType = (IModuleType)theEObject; |
| Object result = caseIModuleType(iModuleType); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case ModuleCorePackage.PROJECT_MODULES: { |
| ProjectModules projectModules = (ProjectModules)theEObject; |
| Object result = caseProjectModules(projectModules); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case ModuleCorePackage.DEPLOYED_MODULE: { |
| DeployedModule deployedModule = (DeployedModule)theEObject; |
| Object result = caseDeployedModule(deployedModule); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| default: return defaultCase(theEObject); |
| } |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Deploy Scheme</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 interpretting the object as an instance of '<em>Deploy Scheme</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseDeployScheme(DeployScheme object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Workbench Module</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 interpretting the object as an instance of '<em>Workbench Module</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseWorkbenchModule(WorkbenchModule object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Workbench Module Resource</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 interpretting the object as an instance of '<em>Workbench Module Resource</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseWorkbenchModuleResource(WorkbenchModuleResource object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Workbench Application</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 interpretting the object as an instance of '<em>Workbench Application</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseWorkbenchApplication(WorkbenchApplication object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>IModule Type</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 interpretting the object as an instance of '<em>IModule Type</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseIModuleType(IModuleType object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Project Modules</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 interpretting the object as an instance of '<em>Project Modules</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseProjectModules(ProjectModules object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting the object as an instance of '<em>Deployed Module</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 interpretting the object as an instance of '<em>Deployed Module</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public Object caseDeployedModule(DeployedModule object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpretting 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 interpretting the object as an instance of '<em>EObject</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) |
| * @generated |
| */ |
| public Object defaultCase(EObject object) { |
| return null; |
| } |
| |
| } //ModuleCoreSwitch |