blob: 844ca0641dda283c4461dc0a725ccb92d7f8eee3 [file] [log] [blame]
/**
* <copyright>
*
* Copyright (c) 2018 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
*
* </copyright>
*/
package org.eclipse.qvtd.xml.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.qvtd.xml.*;
/**
* <!-- 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.xml.XMLmodelPackage
* @generated
*/
public class XMLmodelSwitch<@Nullable T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static XMLmodelPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public XMLmodelSwitch() {
if (modelPackage == null) {
modelPackage = XMLmodelPackage.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: {
Attribute attribute = (Attribute)theEObject;
T result = caseAttribute(attribute);
if (result == null) result = caseNode(attribute);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 1: {
CDATA cdata = (CDATA)theEObject;
T result = caseCDATA(cdata);
if (result == null) result = caseNode(cdata);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 2: {
Characters characters = (Characters)theEObject;
T result = caseCharacters(characters);
if (result == null) result = caseNode(characters);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 3: {
ClassAttribute classAttribute = (ClassAttribute)theEObject;
T result = caseClassAttribute(classAttribute);
if (result == null) result = caseAttribute(classAttribute);
if (result == null) result = caseNode(classAttribute);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 4: {
ClassElement classElement = (ClassElement)theEObject;
T result = caseClassElement(classElement);
if (result == null) result = caseElement(classElement);
if (result == null) result = caseNode(classElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 5: {
Comment comment = (Comment)theEObject;
T result = caseComment(comment);
if (result == null) result = caseNode(comment);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 6: {
DTD dtd = (DTD)theEObject;
T result = caseDTD(dtd);
if (result == null) result = caseNode(dtd);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 7: {
DataTypeAttribute dataTypeAttribute = (DataTypeAttribute)theEObject;
T result = caseDataTypeAttribute(dataTypeAttribute);
if (result == null) result = caseAttribute(dataTypeAttribute);
if (result == null) result = caseNode(dataTypeAttribute);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 8: {
DataTypeElement dataTypeElement = (DataTypeElement)theEObject;
T result = caseDataTypeElement(dataTypeElement);
if (result == null) result = caseElement(dataTypeElement);
if (result == null) result = caseNode(dataTypeElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 9: {
Document document = (Document)theEObject;
T result = caseDocument(document);
if (result == null) result = caseNode(document);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 10: {
Element element = (Element)theEObject;
T result = caseElement(element);
if (result == null) result = caseNode(element);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 11: {
Entity entity = (Entity)theEObject;
T result = caseEntity(entity);
if (result == null) result = caseNode(entity);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 12: {
Node node = (Node)theEObject;
T result = caseNode(node);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 13: {
PrefixMapping prefixMapping = (PrefixMapping)theEObject;
T result = casePrefixMapping(prefixMapping);
if (result == null) result = caseNode(prefixMapping);
if (result == null) result = defaultCase(theEObject);
return result;
}
case 14: {
ProcessingInstruction processingInstruction = (ProcessingInstruction)theEObject;
T result = caseProcessingInstruction(processingInstruction);
if (result == null) result = caseNode(processingInstruction);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* 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>CDATA</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>CDATA</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseCDATA(CDATA object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Characters</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>Characters</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseCharacters(Characters object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Class 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>Class Attribute</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseClassAttribute(ClassAttribute object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Class 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>Class Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseClassElement(ClassElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Comment</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>Comment</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseComment(Comment object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>DTD</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>DTD</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDTD(DTD object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Data Type 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>Data Type Attribute</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDataTypeAttribute(DataTypeAttribute object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Data Type 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>Data Type Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDataTypeElement(DataTypeElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Document</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>Document</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDocument(Document 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>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>Node</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>Node</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNode(Node object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Prefix 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>Prefix Mapping</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T casePrefixMapping(PrefixMapping object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Processing Instruction</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>Processing Instruction</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseProcessingInstruction(ProcessingInstruction 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;
}
} //XMLmodelSwitch