| /******************************************************************************* |
| * Copyright (c) 2014 Bosch Software Innovations GmbH and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * and Eclipse Distribution License v1.0 which accompany this distribution. |
| * |
| * The Eclipse Public License is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * The Eclipse Distribution License is available at |
| * http://www.eclipse.org/org/documents/edl-v10.php. |
| * |
| * Contributors: |
| * Bosch Software Innovations GmbH - Please refer to git log |
| * |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.vorto.functionblock.util; |
| |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EPackage; |
| |
| import org.eclipse.emf.ecore.util.Switch; |
| |
| import org.eclipse.vorto.functionblock.Constraint; |
| import org.eclipse.vorto.functionblock.Entity; |
| import org.eclipse.vorto.functionblock.EnumLiteral; |
| import org.eclipse.vorto.functionblock.Event; |
| import org.eclipse.vorto.functionblock.FBFeature; |
| import org.eclipse.vorto.functionblock.FunctionBlock; |
| import org.eclipse.vorto.functionblock.FunctionblockModel; |
| import org.eclipse.vorto.functionblock.FunctionblockPackage; |
| import org.eclipse.vorto.functionblock.ObjectParam; |
| import org.eclipse.vorto.functionblock.ObjectProperty; |
| import org.eclipse.vorto.functionblock.ObjectType; |
| import org.eclipse.vorto.functionblock.Operation; |
| import org.eclipse.vorto.functionblock.Parameter; |
| import org.eclipse.vorto.functionblock.Presence; |
| import org.eclipse.vorto.functionblock.PrimitiveParam; |
| import org.eclipse.vorto.functionblock.PrimitiveProperty; |
| import org.eclipse.vorto.functionblock.Property; |
| import org.eclipse.vorto.functionblock.ReturnObjectType; |
| import org.eclipse.vorto.functionblock.ReturnPrimitiveType; |
| import org.eclipse.vorto.functionblock.ReturnType; |
| |
| /** |
| * <!-- 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.vorto.functionblock.FunctionblockPackage |
| * @generated |
| */ |
| public class FunctionblockSwitch<T> extends Switch<T> { |
| /** |
| * The cached model package |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected static FunctionblockPackage modelPackage; |
| |
| /** |
| * Creates an instance of the switch. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FunctionblockSwitch() { |
| if (modelPackage == null) { |
| modelPackage = FunctionblockPackage.eINSTANCE; |
| } |
| } |
| |
| /** |
| * Checks whether this is a switch for the given package. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @parameter 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 FunctionblockPackage.FUNCTIONBLOCK_MODEL: { |
| FunctionblockModel functionblockModel = (FunctionblockModel)theEObject; |
| T result = caseFunctionblockModel(functionblockModel); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.FUNCTION_BLOCK: { |
| FunctionBlock functionBlock = (FunctionBlock)theEObject; |
| T result = caseFunctionBlock(functionBlock); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.FB_FEATURE: { |
| FBFeature fbFeature = (FBFeature)theEObject; |
| T result = caseFBFeature(fbFeature); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.OBJECT_TYPE: { |
| ObjectType objectType = (ObjectType)theEObject; |
| T result = caseObjectType(objectType); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.PROPERTY: { |
| Property property = (Property)theEObject; |
| T result = caseProperty(property); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.ENTITY: { |
| Entity entity = (Entity)theEObject; |
| T result = caseEntity(entity); |
| if (result == null) result = caseObjectType(entity); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.PRESENCE: { |
| Presence presence = (Presence)theEObject; |
| T result = casePresence(presence); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.PRIMITIVE_PROPERTY: { |
| PrimitiveProperty primitiveProperty = (PrimitiveProperty)theEObject; |
| T result = casePrimitiveProperty(primitiveProperty); |
| if (result == null) result = caseProperty(primitiveProperty); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.OBJECT_PROPERTY: { |
| ObjectProperty objectProperty = (ObjectProperty)theEObject; |
| T result = caseObjectProperty(objectProperty); |
| if (result == null) result = caseProperty(objectProperty); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.CONSTRAINT: { |
| Constraint constraint = (Constraint)theEObject; |
| T result = caseConstraint(constraint); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.OPERATION: { |
| Operation operation = (Operation)theEObject; |
| T result = caseOperation(operation); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.RETURN_TYPE: { |
| ReturnType returnType = (ReturnType)theEObject; |
| T result = caseReturnType(returnType); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.RETURN_OBJECT_TYPE: { |
| ReturnObjectType returnObjectType = (ReturnObjectType)theEObject; |
| T result = caseReturnObjectType(returnObjectType); |
| if (result == null) result = caseReturnType(returnObjectType); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.RETURN_PRIMITIVE_TYPE: { |
| ReturnPrimitiveType returnPrimitiveType = (ReturnPrimitiveType)theEObject; |
| T result = caseReturnPrimitiveType(returnPrimitiveType); |
| if (result == null) result = caseReturnType(returnPrimitiveType); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.PARAMETER: { |
| Parameter parameter = (Parameter)theEObject; |
| T result = caseParameter(parameter); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.OBJECT_PARAM: { |
| ObjectParam objectParam = (ObjectParam)theEObject; |
| T result = caseObjectParam(objectParam); |
| if (result == null) result = caseParameter(objectParam); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.PRIMITIVE_PARAM: { |
| PrimitiveParam primitiveParam = (PrimitiveParam)theEObject; |
| T result = casePrimitiveParam(primitiveParam); |
| if (result == null) result = caseParameter(primitiveParam); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.ENUM: { |
| org.eclipse.vorto.functionblock.Enum enum_ = (org.eclipse.vorto.functionblock.Enum)theEObject; |
| T result = caseEnum(enum_); |
| if (result == null) result = caseObjectType(enum_); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.ENUM_LITERAL: { |
| EnumLiteral enumLiteral = (EnumLiteral)theEObject; |
| T result = caseEnumLiteral(enumLiteral); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| case FunctionblockPackage.EVENT: { |
| Event event = (Event)theEObject; |
| T result = caseEvent(event); |
| if (result == null) result = defaultCase(theEObject); |
| return result; |
| } |
| default: return defaultCase(theEObject); |
| } |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>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>Model</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseFunctionblockModel(FunctionblockModel object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Function Block</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>Function Block</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseFunctionBlock(FunctionBlock object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>FB Feature</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>FB Feature</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseFBFeature(FBFeature object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Object Type</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>Object Type</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseObjectType(ObjectType object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Property</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>Property</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseProperty(Property object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Entity</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>Entity</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseEntity(Entity object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Presence</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>Presence</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T casePresence(Presence object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Primitive Property</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>Primitive Property</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T casePrimitiveProperty(PrimitiveProperty object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Object Property</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>Object Property</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseObjectProperty(ObjectProperty object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Constraint</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>Constraint</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseConstraint(Constraint object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Operation</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>Operation</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseOperation(Operation object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Return Type</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>Return Type</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseReturnType(ReturnType object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Return Object Type</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>Return Object Type</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseReturnObjectType(ReturnObjectType object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Return Primitive Type</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>Return Primitive Type</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseReturnPrimitiveType(ReturnPrimitiveType object) { |
| return null; |
| } |
| |
| /** |
| * 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 T caseParameter(Parameter object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Object Param</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>Object Param</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseObjectParam(ObjectParam object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Primitive Param</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>Primitive Param</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T casePrimitiveParam(PrimitiveParam object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Enum</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>Enum</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseEnum(org.eclipse.vorto.functionblock.Enum object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Enum Literal</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>Enum Literal</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseEnumLiteral(EnumLiteral object) { |
| return null; |
| } |
| |
| /** |
| * Returns the result of interpreting the object as an instance of '<em>Event</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>Event</em>'. |
| * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| * @generated |
| */ |
| public T caseEvent(Event 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; |
| } |
| |
| } //FunctionblockSwitch |