/* license-start
*
* Copyright (C) 2008 - 2013 Crispico, <http://www.crispico.com/>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details, at <http://www.gnu.org/licenses/>.
*
* Contributors:
* Crispico - Initial API and implementation
*
* license-end
*/
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package com.crispico.flower.mp.model.astcache.code.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import com.crispico.flower.mp.model.astcache.code.Annotation;
import com.crispico.flower.mp.model.astcache.code.AnnotationMember;
import com.crispico.flower.mp.model.astcache.code.AnnotationValue;
import com.crispico.flower.mp.model.astcache.code.AstCacheCodePackage;
import com.crispico.flower.mp.model.astcache.code.Attribute;
import com.crispico.flower.mp.model.astcache.code.DocumentableElement;
import com.crispico.flower.mp.model.astcache.code.EnumConstant;
import com.crispico.flower.mp.model.astcache.code.ExtendedModifier;
import com.crispico.flower.mp.model.astcache.code.ModifiableElement;
import com.crispico.flower.mp.model.astcache.code.Modifier;
import com.crispico.flower.mp.model.astcache.code.Operation;
import com.crispico.flower.mp.model.astcache.code.Parameter;
import com.crispico.flower.mp.model.astcache.code.TypedElement;
import com.crispico.flower.mp.model.codesync.AstCacheElement;
import java.io.Serializable;
/**
* <!-- 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 com.crispico.flower.mp.model.astcache.code.AstCacheCodePackage
* @generated
*/
public class AstCacheCodeSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static AstCacheCodePackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public AstCacheCodeSwitch() {
if (modelPackage == null) {
modelPackage = AstCacheCodePackage.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 AstCacheCodePackage.DOCUMENTABLE_ELEMENT: {
DocumentableElement documentableElement = (DocumentableElement)theEObject;
T result = caseDocumentableElement(documentableElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
case AstCacheCodePackage.TYPED_ELEMENT: {
TypedElement typedElement = (TypedElement)theEObject;
T result = caseTypedElement(typedElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
case AstCacheCodePackage.MODIFIABLE_ELEMENT: {
ModifiableElement modifiableElement = (ModifiableElement)theEObject;
T result = caseModifiableElement(modifiableElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
case AstCacheCodePackage.EXTENDED_MODIFIER: {
ExtendedModifier extendedModifier = (ExtendedModifier)theEObject;
T result = caseExtendedModifier(extendedModifier);
if (result == null) result = caseAstCacheElement(extendedModifier);
if (result == null) result = caseSerializable(extendedModifier);
if (result == null) result = defaultCase(theEObject);
return result;
}
case AstCacheCodePackage.MODIFIER: {
Modifier modifier = (Modifier)theEObject;
T result = caseModifier(modifier);
if (result == null) result = caseExtendedModifier(modifier);
if (result == null) result = caseAstCacheElement(modifier);
if (result == null) result = caseSerializable(modifier);
if (result == null) result = defaultCase(theEObject);
return result;
}
case AstCacheCodePackage.ANNOTATION: {
Annotation annotation = (Annotation)theEObject;
T result = caseAnnotation(annotation);
if (result == null) result = caseExtendedModifier(annotation);
if (result == null) result = caseAstCacheElement(annotation);
if (result == null) result = caseSerializable(annotation);
if (result == null) result = defaultCase(theEObject);
return result;
}
case AstCacheCodePackage.ANNOTATION_VALUE: {
AnnotationValue annotationValue = (AnnotationValue)theEObject;
T result = caseAnnotationValue(annotationValue);
if (result == null) result = caseAstCacheElement(annotationValue);
if (result == null) result = caseSerializable(annotationValue);
if (result == null) result = defaultCase(theEObject);
return result;
}
case AstCacheCodePackage.CLASS: {
com.crispico.flower.mp.model.astcache.code.Class class_ = (com.crispico.flower.mp.model.astcache.code.Class)theEObject;
T result = caseClass(class_);
if (result == null) result = caseAstCacheElement(class_);
if (result == null) result = caseModifiableElement(class_);
if (result == null) result = caseDocumentableElement(class_);
if (result == null) result = caseSerializable(class_);
if (result == null) result = defaultCase(theEObject);
return result;
}
case AstCacheCodePackage.ATTRIBUTE: {
Attribute attribute = (Attribute)theEObject;
T result = caseAttribute(attribute);
if (result == null) result = caseAstCacheElement(attribute);
if (result == null) result = caseModifiableElement(attribute);
if (result == null) result = caseDocumentableElement(attribute);
if (result == null) result = caseTypedElement(attribute);
if (result == null) result = caseSerializable(attribute);
if (result == null) result = defaultCase(theEObject);
return result;
}
case AstCacheCodePackage.OPERATION: {
Operation operation = (Operation)theEObject;
T result = caseOperation(operation);
if (result == null) result = caseAstCacheElement(operation);
if (result == null) result = caseModifiableElement(operation);
if (result == null) result = caseDocumentableElement(operation);
if (result == null) result = caseTypedElement(operation);
if (result == null) result = caseSerializable(operation);
if (result == null) result = defaultCase(theEObject);
return result;
}
case AstCacheCodePackage.PARAMETER: {
Parameter parameter = (Parameter)theEObject;
T result = caseParameter(parameter);
if (result == null) result = caseAstCacheElement(parameter);
if (result == null) result = caseModifiableElement(parameter);
if (result == null) result = caseTypedElement(parameter);
if (result == null) result = caseSerializable(parameter);
if (result == null) result = defaultCase(theEObject);
return result;
}
case AstCacheCodePackage.ENUM_CONSTANT: {
EnumConstant enumConstant = (EnumConstant)theEObject;
T result = caseEnumConstant(enumConstant);
if (result == null) result = caseAstCacheElement(enumConstant);
if (result == null) result = caseModifiableElement(enumConstant);
if (result == null) result = caseDocumentableElement(enumConstant);
if (result == null) result = caseSerializable(enumConstant);
if (result == null) result = defaultCase(theEObject);
return result;
}
case AstCacheCodePackage.ANNOTATION_MEMBER: {
AnnotationMember annotationMember = (AnnotationMember)theEObject;
T result = caseAnnotationMember(annotationMember);
if (result == null) result = caseAstCacheElement(annotationMember);
if (result == null) result = caseModifiableElement(annotationMember);
if (result == null) result = caseDocumentableElement(annotationMember);
if (result == null) result = caseTypedElement(annotationMember);
if (result == null) result = caseSerializable(annotationMember);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Class</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>Class</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseClass(com.crispico.flower.mp.model.astcache.code.Class object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Attribute</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>Attribute</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAttribute(Attribute 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>Documentable 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>Documentable Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDocumentableElement(DocumentableElement 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>Modifiable 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>Modifiable Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseModifiableElement(ModifiableElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Extended Modifier</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>Extended Modifier</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseExtendedModifier(ExtendedModifier object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Modifier</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>Modifier</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseModifier(Modifier object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Annotation</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>Annotation</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAnnotation(Annotation object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Annotation Value</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>Annotation Value</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAnnotationValue(AnnotationValue 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>Enum Constant</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 Constant</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseEnumConstant(EnumConstant object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Annotation Member</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>Annotation Member</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAnnotationMember(AnnotationMember object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Serializable</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>Serializable</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSerializable(Serializable object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Ast Cache 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>Ast Cache Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAstCacheElement(AstCacheElement 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;
}
} //AstCacheCodeSwitch