blob: 35fcee631e24037cc68bbf76434ef1de65182b9f [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011, 2019 Willink Transformations and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* E.D.Willink - initial API and implementation
*******************************************************************************/
package org.eclipse.qvtd.pivot.qvtcore.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.ocl.pivot.Element;
import org.eclipse.ocl.pivot.Model;
import org.eclipse.ocl.pivot.NamedElement;
import org.eclipse.ocl.pivot.Namespace;
import org.eclipse.ocl.pivot.ReferringElement;
import org.eclipse.ocl.pivot.TypedElement;
import org.eclipse.ocl.pivot.Variable;
import org.eclipse.ocl.pivot.VariableDeclaration;
import org.eclipse.qvtd.pivot.qvtbase.BaseModel;
import org.eclipse.qvtd.pivot.qvtbase.Domain;
import org.eclipse.qvtd.pivot.qvtbase.Pattern;
import org.eclipse.qvtd.pivot.qvtbase.Rule;
import org.eclipse.qvtd.pivot.qvtcore.*;
import org.eclipse.qvtd.pivot.qvtcore.Assignment;
import org.eclipse.qvtd.pivot.qvtcore.BottomPattern;
import org.eclipse.qvtd.pivot.qvtcore.CoreDomain;
import org.eclipse.qvtd.pivot.qvtcore.CoreModel;
import org.eclipse.qvtd.pivot.qvtcore.CorePattern;
import org.eclipse.qvtd.pivot.qvtcore.EnforcementOperation;
import org.eclipse.qvtd.pivot.qvtcore.GuardPattern;
import org.eclipse.qvtd.pivot.qvtcore.Mapping;
import org.eclipse.qvtd.pivot.qvtcore.NavigationAssignment;
import org.eclipse.qvtd.pivot.qvtcore.OppositePropertyAssignment;
import org.eclipse.qvtd.pivot.qvtcore.PropertyAssignment;
import org.eclipse.qvtd.pivot.qvtcore.QVTcorePackage;
import org.eclipse.qvtd.pivot.qvtcore.RealizedVariable;
import org.eclipse.qvtd.pivot.qvtcore.VariableAssignment;
/**
* <!-- 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.qvtd.pivot.qvtcore.QVTcorePackage
* @generated
*/
public class QVTcoreSwitch<@Nullable T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static QVTcorePackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public QVTcoreSwitch() {
if (modelPackage == null) {
modelPackage = QVTcorePackage.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 0: {
Area area = (Area)theEObject;
T result = caseArea(area);
if (result == null) result = caseElement(area);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 1: {
Assignment assignment = (Assignment)theEObject;
T result = caseAssignment(assignment);
if (result == null) result = caseElement(assignment);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 2: {
BottomPattern bottomPattern = (BottomPattern)theEObject;
T result = caseBottomPattern(bottomPattern);
if (result == null) result = caseCorePattern(bottomPattern);
if (result == null) result = casePattern(bottomPattern);
if (result == null) result = caseElement(bottomPattern);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 3: {
BottomVariable bottomVariable = (BottomVariable)theEObject;
T result = caseBottomVariable(bottomVariable);
if (result == null) result = caseVariable(bottomVariable);
if (result == null) result = caseVariableDeclaration(bottomVariable);
if (result == null) result = caseTypedElement(bottomVariable);
if (result == null) result = caseNamedElement(bottomVariable);
if (result == null) result = caseElement(bottomVariable);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 4: {
CoreDomain coreDomain = (CoreDomain)theEObject;
T result = caseCoreDomain(coreDomain);
if (result == null) result = caseDomain(coreDomain);
if (result == null) result = caseArea(coreDomain);
if (result == null) result = caseNamedElement(coreDomain);
if (result == null) result = caseReferringElement(coreDomain);
if (result == null) result = caseElement(coreDomain);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 5: {
CoreModel coreModel = (CoreModel)theEObject;
T result = caseCoreModel(coreModel);
if (result == null) result = caseBaseModel(coreModel);
if (result == null) result = caseModel(coreModel);
if (result == null) result = caseNamespace(coreModel);
if (result == null) result = caseNamedElement(coreModel);
if (result == null) result = caseElement(coreModel);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 6: {
CorePattern corePattern = (CorePattern)theEObject;
T result = caseCorePattern(corePattern);
if (result == null) result = casePattern(corePattern);
if (result == null) result = caseElement(corePattern);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 7: {
EnforcementOperation enforcementOperation = (EnforcementOperation)theEObject;
T result = caseEnforcementOperation(enforcementOperation);
if (result == null) result = caseElement(enforcementOperation);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 8: {
GuardPattern guardPattern = (GuardPattern)theEObject;
T result = caseGuardPattern(guardPattern);
if (result == null) result = caseCorePattern(guardPattern);
if (result == null) result = casePattern(guardPattern);
if (result == null) result = caseElement(guardPattern);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 9: {
GuardVariable guardVariable = (GuardVariable)theEObject;
T result = caseGuardVariable(guardVariable);
if (result == null) result = caseVariable(guardVariable);
if (result == null) result = caseVariableDeclaration(guardVariable);
if (result == null) result = caseTypedElement(guardVariable);
if (result == null) result = caseNamedElement(guardVariable);
if (result == null) result = caseElement(guardVariable);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 10: {
Mapping mapping = (Mapping)theEObject;
T result = caseMapping(mapping);
if (result == null) result = caseRule(mapping);
if (result == null) result = caseArea(mapping);
if (result == null) result = caseNamedElement(mapping);
if (result == null) result = caseElement(mapping);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 11: {
NavigationAssignment navigationAssignment = (NavigationAssignment)theEObject;
T result = caseNavigationAssignment(navigationAssignment);
if (result == null) result = caseAssignment(navigationAssignment);
if (result == null) result = caseElement(navigationAssignment);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 12: {
OppositePropertyAssignment oppositePropertyAssignment = (OppositePropertyAssignment)theEObject;
T result = caseOppositePropertyAssignment(oppositePropertyAssignment);
if (result == null) result = caseNavigationAssignment(oppositePropertyAssignment);
if (result == null) result = caseAssignment(oppositePropertyAssignment);
if (result == null) result = caseElement(oppositePropertyAssignment);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 13: {
PropertyAssignment propertyAssignment = (PropertyAssignment)theEObject;
T result = casePropertyAssignment(propertyAssignment);
if (result == null) result = caseNavigationAssignment(propertyAssignment);
if (result == null) result = caseAssignment(propertyAssignment);
if (result == null) result = caseElement(propertyAssignment);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 14: {
RealizedVariable realizedVariable = (RealizedVariable)theEObject;
T result = caseRealizedVariable(realizedVariable);
if (result == null) result = caseVariable(realizedVariable);
if (result == null) result = caseVariableDeclaration(realizedVariable);
if (result == null) result = caseTypedElement(realizedVariable);
if (result == null) result = caseNamedElement(realizedVariable);
if (result == null) result = caseElement(realizedVariable);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 15: {
VariableAssignment variableAssignment = (VariableAssignment)theEObject;
T result = caseVariableAssignment(variableAssignment);
if (result == null) result = caseAssignment(variableAssignment);
if (result == null) result = caseElement(variableAssignment);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Area</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>Area</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseArea(Area object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Assignment</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>Assignment</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAssignment(Assignment object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Bottom Pattern</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>Bottom Pattern</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseBottomPattern(BottomPattern object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Bottom Variable</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>Bottom Variable</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseBottomVariable(BottomVariable object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Core Domain</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>Core Domain</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseCoreDomain(CoreDomain object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Core 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>Core Model</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseCoreModel(CoreModel object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Core Pattern</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>Core Pattern</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseCorePattern(CorePattern object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Enforcement 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>Enforcement Operation</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEnforcementOperation(EnforcementOperation object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Guard Pattern</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>Guard Pattern</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGuardPattern(GuardPattern object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Guard Variable</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>Guard Variable</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGuardVariable(GuardVariable object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Mapping</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>Mapping</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseMapping(Mapping object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Navigation Assignment</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>Navigation Assignment</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNavigationAssignment(NavigationAssignment object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Opposite Property Assignment</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>Opposite Property Assignment</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseOppositePropertyAssignment(OppositePropertyAssignment object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Property Assignment</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 Assignment</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePropertyAssignment(PropertyAssignment object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Realized Variable</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>Realized Variable</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRealizedVariable(RealizedVariable object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Variable Assignment</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>Variable Assignment</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseVariableAssignment(VariableAssignment object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>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>Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseElement(Element object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Pattern</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>Pattern</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePattern(Pattern 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 T caseNamedElement(NamedElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Referring 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>Referring Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseReferringElement(ReferringElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Domain</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>Domain</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDomain(Domain object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Namespace</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>Namespace</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNamespace(Namespace object) {
return null;
}
/**
* 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 caseModel(Model object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Base 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>Base Model</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseBaseModel(BaseModel object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Rule</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>Rule</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRule(Rule object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Typed 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>Typed Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseTypedElement(TypedElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Variable Declaration</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>Variable Declaration</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseVariableDeclaration(VariableDeclaration object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Variable</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>Variable</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseVariable(Variable 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;
}
} //QVTcoreSwitch