/** * <copyright> * </copyright> * * $Id$ */ package org.eclipse.buckminster.rmap.maven.util; import java.util.List; import org.eclipse.buckminster.model.common.Properties; import org.eclipse.buckminster.rmap.Matcher; import org.eclipse.buckminster.rmap.Provider; import org.eclipse.buckminster.rmap.maven.*; 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.maven.MavenPackage * @generated */ public class MavenSwitch<T> { /** * The cached model package <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ protected static MavenPackage modelPackage; /** * Creates an instance of the switch. <!-- begin-user-doc --> <!-- * end-user-doc --> * * @generated */ public MavenSwitch() { if (modelPackage == null) { modelPackage = MavenPackage.eINSTANCE; } } /** * Returns the result of interpreting the object as an instance of ' * <em>Group And Artifact</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>Group And Artifact</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseGroupAndArtifact(GroupAndArtifact object) { return null; } /** * Returns the result of interpreting the object as an instance of ' * <em>Map Entry</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 Entry</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseMapEntry(MapEntry object) { return null; } /** * Returns the result of interpreting the object as an instance of ' * <em>Mappings</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>Mappings</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseMappings(Mappings 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>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 caseMavenProvider(MavenProvider 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>Scope</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>Scope</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseScope(Scope object) { return null; } /** * Returns the result of interpreting the object as an instance of ' * <em>Scopes</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>Scopes</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseScopes(Scopes 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 MavenPackage.GROUP_AND_ARTIFACT: { GroupAndArtifact groupAndArtifact = (GroupAndArtifact) theEObject; T result = caseGroupAndArtifact(groupAndArtifact); if (result == null) result = defaultCase(theEObject); return result; } case MavenPackage.MAP_ENTRY: { MapEntry mapEntry = (MapEntry) theEObject; T result = caseMapEntry(mapEntry); if (result == null) result = caseGroupAndArtifact(mapEntry); if (result == null) result = defaultCase(theEObject); return result; } case MavenPackage.MAPPINGS: { Mappings mappings = (Mappings) theEObject; T result = caseMappings(mappings); if (result == null) result = defaultCase(theEObject); return result; } case MavenPackage.MAVEN_PROVIDER: { MavenProvider mavenProvider = (MavenProvider) theEObject; T result = caseMavenProvider(mavenProvider); if (result == null) result = caseProvider(mavenProvider); if (result == null) result = caseProperties(mavenProvider); if (result == null) result = caseMatcher(mavenProvider); if (result == null) result = defaultCase(theEObject); return result; } case MavenPackage.SCOPES: { Scopes scopes = (Scopes) theEObject; T result = caseScopes(scopes); if (result == null) result = defaultCase(theEObject); return result; } case MavenPackage.SCOPE: { Scope scope = (Scope) theEObject; T result = caseScope(scope); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } } // MavenSwitch