/*********************************************************************************************************************** | |
* Copyright (c) 2010 Attensity Europe GmbH. 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 | |
**********************************************************************************************************************/ | |
package org.eclipse.smila.processing.designer.model.record.util; | |
import java.util.List; | |
import javax.wsdl.extensions.AttributeExtensible; | |
import javax.wsdl.extensions.ElementExtensible; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.EObject; | |
import org.eclipse.smila.processing.designer.model.record.*; | |
import org.eclipse.wst.wsdl.ExtensibleElement; | |
import org.eclipse.wst.wsdl.WSDLElement; | |
/** | |
* <!-- 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.smila.processing.designer.model.record.RecordPackage | |
* @generated | |
*/ | |
public class RecordSwitch<T> { | |
/** | |
* The cached model package <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
protected static RecordPackage modelPackage; | |
/** | |
* Creates an instance of the switch. <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
public RecordSwitch() { | |
if (modelPackage == null) { | |
modelPackage = RecordPackage.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 RecordPackage.RECORD_MAP: { | |
RecordMap recordMap = (RecordMap) theEObject; | |
T result = caseRecordMap(recordMap); | |
if (result == null) { | |
result = caseRecordValues(recordMap); | |
} | |
if (result == null) { | |
result = caseRecordAny(recordMap); | |
} | |
if (result == null) { | |
result = caseExtensionElement(recordMap); | |
} | |
if (result == null) { | |
result = caseBPEL_ExtensibleElement(recordMap); | |
} | |
if (result == null) { | |
result = caseExtensibleElement(recordMap); | |
} | |
if (result == null) { | |
result = caseWSDLElement(recordMap); | |
} | |
if (result == null) { | |
result = caseIElementExtensible(recordMap); | |
} | |
if (result == null) { | |
result = caseIAttributeExtensible(recordMap); | |
} | |
if (result == null) { | |
result = defaultCase(theEObject); | |
} | |
return result; | |
} | |
case RecordPackage.RECORD_SEQ: { | |
RecordSeq recordSeq = (RecordSeq) theEObject; | |
T result = caseRecordSeq(recordSeq); | |
if (result == null) { | |
result = caseRecordValues(recordSeq); | |
} | |
if (result == null) { | |
result = caseRecordAny(recordSeq); | |
} | |
if (result == null) { | |
result = caseExtensionElement(recordSeq); | |
} | |
if (result == null) { | |
result = caseBPEL_ExtensibleElement(recordSeq); | |
} | |
if (result == null) { | |
result = caseExtensibleElement(recordSeq); | |
} | |
if (result == null) { | |
result = caseWSDLElement(recordSeq); | |
} | |
if (result == null) { | |
result = caseIElementExtensible(recordSeq); | |
} | |
if (result == null) { | |
result = caseIAttributeExtensible(recordSeq); | |
} | |
if (result == null) { | |
result = defaultCase(theEObject); | |
} | |
return result; | |
} | |
case RecordPackage.RECORD_VAL: { | |
RecordVal recordVal = (RecordVal) theEObject; | |
T result = caseRecordVal(recordVal); | |
if (result == null) { | |
result = caseRecordAny(recordVal); | |
} | |
if (result == null) { | |
result = caseExtensionElement(recordVal); | |
} | |
if (result == null) { | |
result = caseBPEL_ExtensibleElement(recordVal); | |
} | |
if (result == null) { | |
result = caseExtensibleElement(recordVal); | |
} | |
if (result == null) { | |
result = caseWSDLElement(recordVal); | |
} | |
if (result == null) { | |
result = caseIElementExtensible(recordVal); | |
} | |
if (result == null) { | |
result = caseIAttributeExtensible(recordVal); | |
} | |
if (result == null) { | |
result = defaultCase(theEObject); | |
} | |
return result; | |
} | |
case RecordPackage.RECORD_ANY: { | |
RecordAny recordAny = (RecordAny) theEObject; | |
T result = caseRecordAny(recordAny); | |
if (result == null) { | |
result = caseExtensionElement(recordAny); | |
} | |
if (result == null) { | |
result = caseBPEL_ExtensibleElement(recordAny); | |
} | |
if (result == null) { | |
result = caseExtensibleElement(recordAny); | |
} | |
if (result == null) { | |
result = caseWSDLElement(recordAny); | |
} | |
if (result == null) { | |
result = caseIElementExtensible(recordAny); | |
} | |
if (result == null) { | |
result = caseIAttributeExtensible(recordAny); | |
} | |
if (result == null) { | |
result = defaultCase(theEObject); | |
} | |
return result; | |
} | |
case RecordPackage.EXTENSION_ELEMENT: { | |
ExtensionElement extensionElement = (ExtensionElement) theEObject; | |
T result = caseExtensionElement(extensionElement); | |
if (result == null) { | |
result = caseBPEL_ExtensibleElement(extensionElement); | |
} | |
if (result == null) { | |
result = caseExtensibleElement(extensionElement); | |
} | |
if (result == null) { | |
result = caseWSDLElement(extensionElement); | |
} | |
if (result == null) { | |
result = caseIElementExtensible(extensionElement); | |
} | |
if (result == null) { | |
result = caseIAttributeExtensible(extensionElement); | |
} | |
if (result == null) { | |
result = defaultCase(theEObject); | |
} | |
return result; | |
} | |
case RecordPackage.RECORD_VALUES: { | |
RecordValues recordValues = (RecordValues) theEObject; | |
T result = caseRecordValues(recordValues); | |
if (result == null) { | |
result = caseRecordAny(recordValues); | |
} | |
if (result == null) { | |
result = caseExtensionElement(recordValues); | |
} | |
if (result == null) { | |
result = caseBPEL_ExtensibleElement(recordValues); | |
} | |
if (result == null) { | |
result = caseExtensibleElement(recordValues); | |
} | |
if (result == null) { | |
result = caseWSDLElement(recordValues); | |
} | |
if (result == null) { | |
result = caseIElementExtensible(recordValues); | |
} | |
if (result == null) { | |
result = caseIAttributeExtensible(recordValues); | |
} | |
if (result == null) { | |
result = defaultCase(theEObject); | |
} | |
return result; | |
} | |
default: | |
return defaultCase(theEObject); | |
} | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Map</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>Map</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseRecordMap(RecordMap object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Seq</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>Seq</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseRecordSeq(RecordSeq object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Val</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>Val</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseRecordVal(RecordVal object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Any</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>Any</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseRecordAny(RecordAny object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Extension 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>Extension Element</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseExtensionElement(ExtensionElement object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Values</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>Values</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseRecordValues(RecordValues 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 caseWSDLElement(WSDLElement object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>IElement Extensible</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>IElement Extensible</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseIElementExtensible(ElementExtensible object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>IAttribute Extensible</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>IAttribute Extensible</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseIAttributeExtensible(AttributeExtensible object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Extensible 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>Extensible Element</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseExtensibleElement(ExtensibleElement object) { | |
return null; | |
} | |
/** | |
* Returns the result of interpreting the object as an instance of '<em>Extensible 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>Extensible Element</em>'. | |
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | |
* @generated | |
*/ | |
public T caseBPEL_ExtensibleElement(org.eclipse.bpel.model.ExtensibleElement 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; | |
} | |
} // RecordSwitch |