| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Jose C. Dominguez - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.strategy.util; |
| |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EPackage; |
| |
| import org.eclipse.emf.ecore.util.Switch; |
| |
| import org.eclipse.osbp.dsl.semantic.common.types.LLazyResolver; |
| import org.eclipse.osbp.dsl.semantic.common.types.LPackage; |
| |
| import org.eclipse.osbp.xtext.strategy.*; |
| |
| /** |
| * <!-- 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.osbp.xtext.strategy.StrategyDSLPackage |
| * @generated |
| */ |
| public class StrategyDSLSwitch<T> extends Switch<T> { |
| /** |
| * The cached model package |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected static StrategyDSLPackage modelPackage; |
| |
| /** |
| * Creates an instance of the switch. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public StrategyDSLSwitch() { |
| if (modelPackage == null) { |
| modelPackage = StrategyDSLPackage.eINSTANCE; |
| } |
| } |
| |
| /** |
| * Checks whether this is a switch for the given package. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param ePackage the package in question. |
| * @return whether this is a switch for the given package. |
| * @generated |
| */ |
| @Override |
| protected boolean isSwitchFor(EPackage ePackage) { |
| return ePackage == modelPackage; |
| } |
| |
| /** |
| * 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 |
| */ |
| @Override |
| protected T doSwitch(int classifierID, EObject theEObject) { |
| switch (classifierID) { |
| case StrategyDSLPackage.STRATEGY_MODEL: { |
| StrategyModel strategyModel = (StrategyModel)theEObject; |
| T result = caseStrategyModel(strategyModel); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case StrategyDSLPackage.STRATEGY_LAZY_RESOLVER: { |
| StrategyLazyResolver strategyLazyResolver = (StrategyLazyResolver)theEObject; |
| T result = caseStrategyLazyResolver(strategyLazyResolver); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case StrategyDSLPackage.STRATEGY_BASE: { |
| StrategyBase strategyBase = (StrategyBase)theEObject; |
| T result = caseStrategyBase(strategyBase); |
| if (result == null) result = caseStrategyLazyResolver(strategyBase); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case StrategyDSLPackage.STRATEGY_PACKAGE: { |
| StrategyPackage strategyPackage = (StrategyPackage)theEObject; |
| T result = caseStrategyPackage(strategyPackage); |
| if (result == null) result = caseLPackage(strategyPackage); |
| if (result == null) result = caseLLazyResolver(strategyPackage); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case StrategyDSLPackage.STRATEGY: { |
| Strategy strategy = (Strategy)theEObject; |
| T result = caseStrategy(strategy); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case StrategyDSLPackage.STRATEGY_TARGET: { |
| StrategyTarget strategyTarget = (StrategyTarget)theEObject; |
| T result = caseStrategyTarget(strategyTarget); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case StrategyDSLPackage.LAYOUTING_STRATEGY: { |
| LayoutingStrategy layoutingStrategy = (LayoutingStrategy)theEObject; |
| T result = caseLayoutingStrategy(layoutingStrategy); |
| if (result == null) result = caseStrategyBase(layoutingStrategy); |
| if (result == null) result = caseStrategyLazyResolver(layoutingStrategy); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case StrategyDSLPackage.FOCUSING_STRATEGY: { |
| FocusingStrategy focusingStrategy = (FocusingStrategy)theEObject; |
| T result = caseFocusingStrategy(focusingStrategy); |
| if (result == null) result = caseStrategyBase(focusingStrategy); |
| if (result == null) result = caseStrategyLazyResolver(focusingStrategy); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case StrategyDSLPackage.FOCUSING_ENHANCER: { |
| FocusingEnhancer focusingEnhancer = (FocusingEnhancer)theEObject; |
| T result = caseFocusingEnhancer(focusingEnhancer); |
| if (result == null) result = caseStrategyBase(focusingEnhancer); |
| if (result == null) result = caseStrategyLazyResolver(focusingEnhancer); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case StrategyDSLPackage.STRATEGY_DEFAULT: { |
| StrategyDefault strategyDefault = (StrategyDefault)theEObject; |
| T result = caseStrategyDefault(strategyDefault); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| default: return defaultCase(theEObject); |
| } |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Strategy 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>Strategy Model</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseStrategyModel(StrategyModel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Strategy Lazy Resolver</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>Strategy Lazy Resolver</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseStrategyLazyResolver(StrategyLazyResolver object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Strategy Base</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>Strategy Base</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseStrategyBase(StrategyBase object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Strategy Package</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>Strategy Package</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseStrategyPackage(StrategyPackage object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Strategy</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>Strategy</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseStrategy(Strategy object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Strategy Target</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>Strategy Target</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseStrategyTarget(StrategyTarget object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Layouting Strategy</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>Layouting Strategy</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseLayoutingStrategy(LayoutingStrategy object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Focusing Strategy</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>Focusing Strategy</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseFocusingStrategy(FocusingStrategy object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Focusing Enhancer</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>Focusing Enhancer</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseFocusingEnhancer(FocusingEnhancer object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Strategy Default</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>Strategy Default</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseStrategyDefault(StrategyDefault object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>LLazy Resolver</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>LLazy Resolver</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseLLazyResolver(LLazyResolver object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>LPackage</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>LPackage</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseLPackage(LPackage 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 |
| */ |
| @Override |
| public T defaultCase(EObject object) { |
| return null; |
| } |
| |
| } //StrategyDSLSwitch |