/** */ package com.hundsun.ares.studio.biz.util; import com.hundsun.ares.studio.biz.*; import java.util.List; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import com.hundsun.ares.studio.biz.ARESObject; import com.hundsun.ares.studio.biz.BizInterface; import com.hundsun.ares.studio.biz.BizPackage; import com.hundsun.ares.studio.biz.Parameter; import com.hundsun.ares.studio.core.model.BasicResourceInfo; import com.hundsun.ares.studio.core.model.ExtensibleModel; import com.hundsun.ares.studio.core.model.IJSONData; import com.hundsun.ares.studio.core.model.IReferenceProvider; import com.hundsun.ares.studio.core.model.JRESResourceInfo; import com.hundsun.ares.studio.jres.model.metadata.ErrorNoItem; import com.hundsun.ares.studio.jres.model.metadata.MetadataItem; import com.hundsun.ares.studio.jres.model.metadata.MetadataResourceData; import com.hundsun.ares.studio.jres.model.metadata.NamedElement; /** * <!-- 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 com.hundsun.ares.studio.biz.BizPackage * @generated */ public class BizSwitch<T1> { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static BizPackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BizSwitch() { if (modelPackage == null) { modelPackage = BizPackage.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 T1 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 T1 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 T1 doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case BizPackage.PARAMETER: { Parameter parameter = (Parameter)theEObject; T1 result = caseParameter(parameter); if (result == null) result = caseExtensibleModel(parameter); if (result == null) result = caseIJSONData(parameter); if (result == null) result = defaultCase(theEObject); return result; } case BizPackage.BIZ_INTERFACE: { BizInterface bizInterface = (BizInterface)theEObject; T1 result = caseBizInterface(bizInterface); if (result == null) result = defaultCase(theEObject); return result; } case BizPackage.ARES_OBJECT: { ARESObject aresObject = (ARESObject)theEObject; T1 result = caseARESObject(aresObject); if (result == null) result = caseJRESResourceInfo(aresObject); if (result == null) result = caseExtensibleModel(aresObject); if (result == null) result = caseBasicResourceInfo(aresObject); if (result == null) result = caseIReferenceProvider(aresObject); if (result == null) result = caseIJSONData(aresObject); if (result == null) result = defaultCase(theEObject); return result; } case BizPackage.STANDARD_OBJ_FIELD_LIST: { StandardObjFieldList standardObjFieldList = (StandardObjFieldList)theEObject; T1 result = caseStandardObjFieldList(standardObjFieldList); if (result == null) result = caseMetadataResourceData(standardObjFieldList); if (result == null) result = caseJRESResourceInfo(standardObjFieldList); if (result == null) result = caseExtensibleModel(standardObjFieldList); if (result == null) result = caseBasicResourceInfo(standardObjFieldList); if (result == null) result = caseIReferenceProvider(standardObjFieldList); if (result == null) result = caseIJSONData(standardObjFieldList); if (result == null) result = defaultCase(theEObject); return result; } case BizPackage.STANDARD_OBJ_FIELD: { StandardObjField standardObjField = (StandardObjField)theEObject; T1 result = caseStandardObjField(standardObjField); if (result == null) result = caseMetadataItem(standardObjField); if (result == null) result = caseNamedElement(standardObjField); if (result == null) result = caseExtensibleModel(standardObjField); if (result == null) result = caseIJSONData(standardObjField); if (result == null) result = defaultCase(theEObject); return result; } case BizPackage.ERROR_INFO: { ErrorInfo errorInfo = (ErrorInfo)theEObject; T1 result = caseErrorInfo(errorInfo); if (result == null) result = caseErrorNoItem(errorInfo); if (result == null) result = caseMetadataItem(errorInfo); if (result == null) result = caseNamedElement(errorInfo); if (result == null) result = caseExtensibleModel(errorInfo); if (result == null) result = caseIJSONData(errorInfo); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * 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 T1 caseParameter(Parameter object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Interface</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>Interface</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseBizInterface(BizInterface object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>ARES Object</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>ARES Object</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseARESObject(ARESObject object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Standard Obj Field List</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>Standard Obj Field List</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseStandardObjFieldList(StandardObjFieldList object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Standard Obj Field</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>Standard Obj Field</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseStandardObjField(StandardObjField object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Error Info</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>Error Info</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseErrorInfo(ErrorInfo object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>IJSON 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 interpreting the object as an instance of '<em>IJSON Data</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseIJSONData(IJSONData object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Extensible Model</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 Model</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseExtensibleModel(ExtensibleModel object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Basic Resource Info</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>Basic Resource Info</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseBasicResourceInfo(BasicResourceInfo object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>IReference Provider</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>IReference Provider</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseIReferenceProvider(IReferenceProvider object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>JRES Resource Info</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>JRES Resource Info</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseJRESResourceInfo(JRESResourceInfo object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Resource 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 interpreting the object as an instance of '<em>Resource Data</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public <T extends MetadataItem> T1 caseMetadataResourceData(MetadataResourceData<T> object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Named 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>Named Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseNamedElement(NamedElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Item</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>Item</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseMetadataItem(MetadataItem object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Error No Item</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>Error No Item</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T1 caseErrorNoItem(ErrorNoItem 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 T1 defaultCase(EObject object) { return null; } } //BizSwitch