/******************************************************************************* * Copyright © 2011, 2013 IBM Corporation 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 * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * *******************************************************************************/ package org.eclipse.edt.ide.ui.internal.deployment.util; import java.util.List; import org.eclipse.edt.ide.ui.internal.deployment.*; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; /** * <!-- 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.edt.ide.ui.internal.deployment.DeploymentPackage * @generated */ public class DeploymentSwitch<T> { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static DeploymentPackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DeploymentSwitch() { if (modelPackage == null) { modelPackage = DeploymentPackage.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 DeploymentPackage.BINDING: { Binding binding = (Binding)theEObject; T result = caseBinding(binding); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.BINDINGS: { Bindings bindings = (Bindings)theEObject; T result = caseBindings(bindings); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.DEPLOY_EXT: { DeployExt deployExt = (DeployExt)theEObject; T result = caseDeployExt(deployExt); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.DEPLOYMENT: { Deployment deployment = (Deployment)theEObject; T result = caseDeployment(deployment); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.DEPLOYMENT_PROJECT: { DeploymentProject deploymentProject = (DeploymentProject)theEObject; T result = caseDeploymentProject(deploymentProject); if (result == null) result = caseDeploymentTarget(deploymentProject); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.DEPLOYMENT_TARGET: { DeploymentTarget deploymentTarget = (DeploymentTarget)theEObject; T result = caseDeploymentTarget(deploymentTarget); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.EGL_DEPLOYMENT_ROOT: { EGLDeploymentRoot eglDeploymentRoot = (EGLDeploymentRoot)theEObject; T result = caseEGLDeploymentRoot(eglDeploymentRoot); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.INCLUDE: { Include include = (Include)theEObject; T result = caseInclude(include); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.PARAMETER: { Parameter parameter = (Parameter)theEObject; T result = caseParameter(parameter); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.PARAMETERS: { Parameters parameters = (Parameters)theEObject; T result = caseParameters(parameters); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.RESOURCE: { Resource resource = (Resource)theEObject; T result = caseResource(resource); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.RESOURCE_OMISSIONS: { ResourceOmissions resourceOmissions = (ResourceOmissions)theEObject; T result = caseResourceOmissions(resourceOmissions); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.RUI_APPLICATION: { RUIApplication ruiApplication = (RUIApplication)theEObject; T result = caseRUIApplication(ruiApplication); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.RUI_HANDLER: { RUIHandler ruiHandler = (RUIHandler)theEObject; T result = caseRUIHandler(ruiHandler); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.SERVICE: { Service service = (Service)theEObject; T result = caseService(service); if (result == null) result = defaultCase(theEObject); return result; } case DeploymentPackage.SERVICES: { Services services = (Services)theEObject; T result = caseServices(services); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * Returns the result of interpreting the object as an instance of '<em>Binding</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>Binding</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseBinding(Binding object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Bindings</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>Bindings</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseBindings(Bindings object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Deploy Ext</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>Deploy Ext</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDeployExt(DeployExt object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Deployment</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>Deployment</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDeployment(Deployment object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Project</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>Project</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDeploymentProject(DeploymentProject object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Target</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>Target</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDeploymentTarget(DeploymentTarget object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>EGL Deployment Root</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>EGL Deployment Root</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseEGLDeploymentRoot(EGLDeploymentRoot object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Include</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>Include</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseInclude(Include object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Parameter</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>Parameter</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseParameter(Parameter object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Parameters</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>Parameters</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseParameters(Parameters object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>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 interpreting the object as an instance of '<em>Resource</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseResource(Resource object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Resource Omissions</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>Resource Omissions</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseResourceOmissions(ResourceOmissions object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>RUI 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 interpreting the object as an instance of '<em>RUI Application</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseRUIApplication(RUIApplication object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>RUI Handler</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>RUI Handler</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseRUIHandler(RUIHandler object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Service</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>Service</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseService(Service object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Services</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>Services</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseServices(Services 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; } } //DeploymentSwitch