/*************************************************************************************************** * Copyright (c) 2005-2007 Eteration A.S. and Gorkem Ercan 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: Gorkem Ercan * Contributors: Naci Dai * **************************************************************************************************/ package org.eclipse.jst.server.generic.internal.servertype.definition.util; import java.util.List; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.jst.server.generic.internal.servertype.definition.ServerTypePackage; import org.eclipse.jst.server.generic.servertype.definition.*; /** * <!-- 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.jst.server.generic.internal.servertype.definition.ServerTypePackage * @generated */ public class ServerTypeSwitch { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static ServerTypePackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ServerTypeSwitch() { if (modelPackage == null) { modelPackage = ServerTypePackage.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 ServerTypePackage.ARCHIVE_TYPE: { ArchiveType archiveType = (ArchiveType)theEObject; Object result = caseArchiveType(archiveType); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.ARGUMENT_PAIR: { ArgumentPair argumentPair = (ArgumentPair)theEObject; Object result = caseArgumentPair(argumentPair); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.CLASSPATH: { Classpath classpath = (Classpath)theEObject; Object result = caseClasspath(classpath); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.EXCLUDE_TYPE: { ExcludeType excludeType = (ExcludeType)theEObject; Object result = caseExcludeType(excludeType); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.EXTERNAL: { External external = (External)theEObject; Object result = caseExternal(external); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.FILESET_TYPE: { FilesetType filesetType = (FilesetType)theEObject; Object result = caseFilesetType(filesetType); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.INCLUDE_TYPE: { IncludeType includeType = (IncludeType)theEObject; Object result = caseIncludeType(includeType); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.JNDI_CONNECTION: { JndiConnection jndiConnection = (JndiConnection)theEObject; Object result = caseJndiConnection(jndiConnection); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.LAUNCH_CONFIGURATION: { LaunchConfiguration launchConfiguration = (LaunchConfiguration)theEObject; Object result = caseLaunchConfiguration(launchConfiguration); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.MODULE: { Module module = (Module)theEObject; Object result = caseModule(module); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.PORT: { Port port = (Port)theEObject; Object result = casePort(port); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.PROJECT: { Project project = (Project)theEObject; Object result = caseProject(project); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.PROPERTY: { Property property = (Property)theEObject; Object result = caseProperty(property); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.PUBLISHER: { Publisher publisher = (Publisher)theEObject; Object result = casePublisher(publisher); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.PUBLISHER_DATA: { PublisherData publisherData = (PublisherData)theEObject; Object result = casePublisherData(publisherData); if (result == null) result = defaultCase(theEObject); return result; } case ServerTypePackage.SERVER_RUNTIME: { ServerRuntime serverRuntime = (ServerRuntime)theEObject; Object result = caseServerRuntime(serverRuntime); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * Returns the result of interpretting the object as an instance of '<em>Archive 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>Archive Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseArchiveType(ArchiveType object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>Argument Pair</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>Argument Pair</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseArgumentPair(ArgumentPair object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>Classpath</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>Classpath</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseClasspath(Classpath object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>Exclude 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>Exclude Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseExcludeType(ExcludeType object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>External</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>External</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseExternal(External object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>Fileset 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>Fileset Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseFilesetType(FilesetType object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>Include 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>Include Type</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseIncludeType(IncludeType object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>Jndi 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 interpretting the object as an instance of '<em>Jndi Connection</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseJndiConnection(JndiConnection object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>Launch Configuration</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>Launch Configuration</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseLaunchConfiguration(LaunchConfiguration object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>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>Module</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseModule(Module object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>Port</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>Port</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object casePort(Port object) { return null; } /** * Returns the result of interpretting 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 interpretting the object as an instance of '<em>Project</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseProject(Project object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>Property</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>Property</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseProperty(Property object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>Publisher</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>Publisher</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object casePublisher(Publisher object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>Publisher Data</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>Publisher Data</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object casePublisherData(PublisherData object) { return null; } /** * Returns the result of interpretting the object as an instance of '<em>Server Runtime</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>Server Runtime</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public Object caseServerRuntime(ServerRuntime 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; } } //ServerTypeSwitch