/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.eclipse.buckminster.rmap.util;
import java.util.List;
import org.eclipse.buckminster.model.common.Properties;
import org.eclipse.buckminster.model.common.RxAssembly;
import org.eclipse.buckminster.model.common.RxGroup;
import org.eclipse.buckminster.model.common.RxPart;
import org.eclipse.buckminster.rmap.*;
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.buckminster.rmap.RmapPackage
* @generated
*/
public class RmapSwitch<T> {
/**
* The cached model package <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected static RmapPackage modelPackage;
/**
* Creates an instance of the switch. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
*/
public RmapSwitch() {
if (modelPackage == null) {
modelPackage = RmapPackage.eINSTANCE;
}
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Abstract Document 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>Abstract Document Root</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAbstractDocumentRoot(EObject object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Branch Point</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>Branch Point</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseBranchPoint(BranchPoint object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Document 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>Document Root</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDocumentRoot(EObject object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Locator</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>Locator</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseLocator(Locator object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Matcher</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>Matcher</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseMatcher(Matcher object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Properties</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>Properties</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseProperties(Properties object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>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>Provider</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseProvider(Provider object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Redirect</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>Redirect</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRedirect(Redirect object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Repository</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>Repository</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRepository(Repository object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Resource 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>Resource Map</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseResourceMap(ResourceMap object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Rx Assembly</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>Rx Assembly</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRxAssembly(RxAssembly object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Rx Group</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>Rx Group</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRxGroup(RxGroup object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Rx Part</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>Rx Part</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRxPart(RxPart object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Search Path</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>Search Path</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSearchPath(SearchPath object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Transform</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>Transform</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTransform(Transform object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>URI Matcher</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>URI Matcher</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseURIMatcher(URIMatcher object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '
* <em>Version Converter</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>Version Converter</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseVersionConverter(VersionConverter 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;
}
/**
* 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 RmapPackage.BRANCH_POINT: {
BranchPoint branchPoint = (BranchPoint) theEObject;
T result = caseBranchPoint(branchPoint);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case RmapPackage.DOCUMENT_ROOT: {
EObject documentRoot = theEObject;
T result = caseDocumentRoot(documentRoot);
if (result == null)
result = caseAbstractDocumentRoot(documentRoot);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case RmapPackage.LOCATOR: {
Locator locator = (Locator) theEObject;
T result = caseLocator(locator);
if (result == null)
result = caseMatcher(locator);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case RmapPackage.MATCHER: {
Matcher matcher = (Matcher) theEObject;
T result = caseMatcher(matcher);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case RmapPackage.PROVIDER: {
Provider provider = (Provider) theEObject;
T result = caseProvider(provider);
if (result == null)
result = caseProperties(provider);
if (result == null)
result = caseMatcher(provider);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case RmapPackage.REDIRECT: {
Redirect redirect = (Redirect) theEObject;
T result = caseRedirect(redirect);
if (result == null)
result = caseMatcher(redirect);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case RmapPackage.REPOSITORY: {
Repository repository = (Repository) theEObject;
T result = caseRepository(repository);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case RmapPackage.RESOURCE_MAP: {
ResourceMap resourceMap = (ResourceMap) theEObject;
T result = caseResourceMap(resourceMap);
if (result == null)
result = caseProperties(resourceMap);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case RmapPackage.SEARCH_PATH: {
SearchPath searchPath = (SearchPath) theEObject;
T result = caseSearchPath(searchPath);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case RmapPackage.TRANSFORM: {
Transform transform = (Transform) theEObject;
T result = caseTransform(transform);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case RmapPackage.URI_MATCHER: {
URIMatcher uriMatcher = (URIMatcher) theEObject;
T result = caseURIMatcher(uriMatcher);
if (result == null)
result = caseRxAssembly(uriMatcher);
if (result == null)
result = caseRxGroup(uriMatcher);
if (result == null)
result = caseRxPart(uriMatcher);
if (result == null)
result = defaultCase(theEObject);
return result;
}
case RmapPackage.VERSION_CONVERTER: {
VersionConverter versionConverter = (VersionConverter) theEObject;
T result = caseVersionConverter(versionConverter);
if (result == null)
result = defaultCase(theEObject);
return result;
}
default:
return defaultCase(theEObject);
}
}
} // RmapSwitch