blob: 8f2ebedba39d87b7b490610a0df0c7680e7c9453 [file] [log] [blame]
/**
* <copyright>
*******************************************************************************
* Copyright (c) 2004 Eteration Bilisim A.S.
* All rights reserved.   This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Eteration Bilisim A.S. For more
* information on eteration, please see
* <http://www.eteration.com/>.
***************************************************************************
* </copyright>
*
* $Id: ServerTypeSwitch.java,v 1.7 2005/08/30 21:45:51 gercan Exp $
*/
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.EXTERNAL: {
External external = (External)theEObject;
Object result = caseExternal(external);
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>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>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