blob: 752eaa6046ea0cbfb343f65c65d696d5ad6f3170 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2006, 2018 IBM Corporation, Zeligsoft Inc., 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:
* IBM - Initial API and implementation
* Zeligsoft - Bug 207365
*******************************************************************************/
package org.eclipse.ocl.types.util;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.ocl.types.AnyType;
import org.eclipse.ocl.types.BagType;
import org.eclipse.ocl.types.CollectionType;
import org.eclipse.ocl.types.ElementType;
import org.eclipse.ocl.types.InvalidType;
import org.eclipse.ocl.types.MessageType;
import org.eclipse.ocl.types.OrderedSetType;
import org.eclipse.ocl.types.PrimitiveType;
import org.eclipse.ocl.types.SequenceType;
import org.eclipse.ocl.types.SetType;
import org.eclipse.ocl.types.TemplateParameterType;
import org.eclipse.ocl.types.TupleType;
import org.eclipse.ocl.types.TypeType;
import org.eclipse.ocl.types.TypesPackage;
import org.eclipse.ocl.types.VoidType;
import org.eclipse.ocl.utilities.ASTNode;
import org.eclipse.ocl.utilities.PredefinedType;
import org.eclipse.ocl.utilities.TypedASTNode;
/**
* <!-- begin-user-doc -->
* The <b>Adapter Factory</b> for the model.
* It provides an adapter <code>createXXX</code> method for each class of the model.
* <!-- end-user-doc -->
* @see org.eclipse.ocl.types.TypesPackage
* @generated
*/
public class TypesAdapterFactory
extends AdapterFactoryImpl {
/**
* The cached model package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static TypesPackage modelPackage;
/**
* Creates an instance of the adapter factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TypesAdapterFactory() {
if (modelPackage == null) {
modelPackage = TypesPackage.eINSTANCE;
}
}
/**
* Returns whether this factory is applicable for the type of the object.
* <!-- begin-user-doc -->
* This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
* <!-- end-user-doc -->
* @return whether this factory is applicable for the type of the object.
* @generated
*/
@Override
public boolean isFactoryForType(Object object) {
if (object == modelPackage) {
return true;
}
if (object instanceof EObject) {
return ((EObject) object).eClass().getEPackage() == modelPackage;
}
return false;
}
/**
* The switch that delegates to the <code>createXXX</code> methods.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TypesSwitch<Adapter> modelSwitch = new TypesSwitch<Adapter>() {
@Override
public <O> Adapter caseAnyType(AnyType<O> object) {
return createAnyTypeAdapter();
}
@Override
public <C, O> Adapter caseBagType(BagType<C, O> object) {
return createBagTypeAdapter();
}
@Override
public <C, O> Adapter caseCollectionType(CollectionType<C, O> object) {
return createCollectionTypeAdapter();
}
@Override
public Adapter caseElementType(ElementType object) {
return createElementTypeAdapter();
}
@Override
public <O> Adapter caseInvalidType(InvalidType<O> object) {
return createInvalidTypeAdapter();
}
@Override
public <C, O, P> Adapter caseMessageType(MessageType<C, O, P> object) {
return createMessageTypeAdapter();
}
@Override
public <C, O> Adapter caseOrderedSetType(OrderedSetType<C, O> object) {
return createOrderedSetTypeAdapter();
}
@Override
public <O> Adapter casePrimitiveType(PrimitiveType<O> object) {
return createPrimitiveTypeAdapter();
}
@Override
public <C, O> Adapter caseSequenceType(SequenceType<C, O> object) {
return createSequenceTypeAdapter();
}
@Override
public <C, O> Adapter caseSetType(SetType<C, O> object) {
return createSetTypeAdapter();
}
@Override
public <O> Adapter caseTemplateParameterType(
TemplateParameterType<O> object) {
return createTemplateParameterTypeAdapter();
}
@Override
public <O, P> Adapter caseTupleType(TupleType<O, P> object) {
return createTupleTypeAdapter();
}
@Override
public <C, O> Adapter caseTypeType(TypeType<C, O> object) {
return createTypeTypeAdapter();
}
@Override
public <O> Adapter caseVoidType(VoidType<O> object) {
return createVoidTypeAdapter();
}
@Override
public <O> Adapter casePredefinedType(PredefinedType<O> object) {
return createPredefinedTypeAdapter();
}
@Override
public Adapter caseASTNode(ASTNode object) {
return createASTNodeAdapter();
}
@Override
public Adapter caseTypedASTNode(TypedASTNode object) {
return createTypedASTNodeAdapter();
}
@Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
};
/**
* Creates an adapter for the <code>target</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param target the object to adapt.
* @return the adapter for the <code>target</code>.
* @generated
*/
@Override
public Adapter createAdapter(Notifier target) {
return modelSwitch.doSwitch((EObject) target);
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.AnyType <em>Any Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.AnyType
* @generated
*/
public Adapter createAnyTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.BagType <em>Bag Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.BagType
* @generated
*/
public Adapter createBagTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.CollectionType <em>Collection Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.CollectionType
* @generated
*/
public Adapter createCollectionTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.ElementType <em>Element Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.ElementType
* @generated
*/
public Adapter createElementTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.InvalidType <em>Invalid Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.InvalidType
* @generated
*/
public Adapter createInvalidTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.MessageType <em>Message Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.MessageType
* @generated
*/
public Adapter createMessageTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.OrderedSetType <em>Ordered Set Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.OrderedSetType
* @generated
*/
public Adapter createOrderedSetTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.PrimitiveType <em>Primitive Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.PrimitiveType
* @generated
*/
public Adapter createPrimitiveTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.SequenceType <em>Sequence Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.SequenceType
* @generated
*/
public Adapter createSequenceTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.SetType <em>Set Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.SetType
* @generated
*/
public Adapter createSetTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.TupleType <em>Tuple Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.TupleType
* @generated
*/
public Adapter createTupleTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.TypeType <em>Type Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.TypeType
* @generated
*/
public Adapter createTypeTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.VoidType <em>Void Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.VoidType
* @generated
*/
public Adapter createVoidTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.types.TemplateParameterType <em>Template Parameter Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* @since 3.0
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.types.TemplateParameterType
* @generated
*/
public Adapter createTemplateParameterTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.utilities.PredefinedType <em>Predefined Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.utilities.PredefinedType
* @generated
*/
public Adapter createPredefinedTypeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.utilities.ASTNode <em>AST Node</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.utilities.ASTNode
* @generated
*/
public Adapter createASTNodeAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.ocl.utilities.TypedASTNode <em>Typed AST Node</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.ocl.utilities.TypedASTNode
* @generated
*/
public Adapter createTypedASTNodeAdapter() {
return null;
}
/**
* Creates a new adapter for the default case.
* <!-- begin-user-doc -->
* This default implementation returns null.
* <!-- end-user-doc -->
* @return the new adapter.
* @generated
*/
public Adapter createEObjectAdapter() {
return null;
}
} //TypesAdapterFactory