blob: 5a829ecb1e3355afa588ad8e9d4d7e7933e5e7ba [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2001, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jst.j2ee.application.internal.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.emf.ecore.EPackage;
import org.eclipse.jst.j2ee.application.Application;
import org.eclipse.jst.j2ee.application.ApplicationPackage;
import org.eclipse.jst.j2ee.application.ConnectorModule;
import org.eclipse.jst.j2ee.application.EjbModule;
import org.eclipse.jst.j2ee.application.JavaClientModule;
import org.eclipse.jst.j2ee.application.Module;
import org.eclipse.jst.j2ee.application.WebModule;
import org.eclipse.jst.j2ee.common.CompatibilityDescriptionGroup;
import org.eclipse.jst.j2ee.common.DescriptionGroup;
import org.eclipse.jst.j2ee.common.J2EEEObject;
public class ApplicationAdapterFactory extends AdapterFactoryImpl {
protected static ApplicationPackage modelPackage;
public ApplicationAdapterFactory() {
if (modelPackage == null) {
modelPackage = (ApplicationPackage)EPackage.Registry.INSTANCE.getEPackage(ApplicationPackage.eNS_URI);
}
}
public boolean isFactoryForType(Object type) {
if (type == modelPackage) {
return true;
}
if (type instanceof EObject) {
return ((EObject)type).eClass().eContainer() == modelPackage;
}
return false;
}
protected ApplicationSwitch sw = new ApplicationSwitch() {
public Object caseApplication(Application object) {
return createApplicationAdapter();
}
public Object caseModule(Module object) {
return createModuleAdapter();
}
public Object caseWebModule(WebModule object) {
return createWebModuleAdapter();
}
public Object caseJavaClientModule(JavaClientModule object) {
return createJavaClientModuleAdapter();
}
public Object caseEjbModule(EjbModule object) {
return createEjbModuleAdapter();
}
public Object caseConnectorModule(ConnectorModule object) {
return createConnectorModuleAdapter();
}
};
public Adapter createAdapter(Notifier target) {
return (Adapter)sw.doSwitch((EObject)target);
}
/**
* By default create methods return null so that we can easily ignore cases.
* It's useful to ignore a case when inheritance will catch all the cases anyway.
*/
public Adapter createApplicationAdapter() {
return null;
}
public Adapter createModuleAdapter() {
return null;
}
public Adapter createWebModuleAdapter() {
return null;
}
public Adapter createJavaClientModuleAdapter() {
return null;
}
public Adapter createEjbModuleAdapter() {
return null;
}
public Adapter createConnectorModuleAdapter() {
return null;
}
/**
* @generated This field/method will be replaced during code generation.
*/
public boolean isFactoryForTypeGen(Object object) {
if (object == modelPackage) {
return true;
}
if (object instanceof EObject) {
return ((EObject)object).eClass().getEPackage() == modelPackage;
}
return false;
}
/**
* The switch the delegates to the <code>createXXX</code> methods.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ApplicationSwitch modelSwitch =
new ApplicationSwitch() {
public Object caseApplication(Application object) {
return createApplicationAdapter();
}
public Object caseModule(Module object) {
return createModuleAdapter();
}
public Object caseWebModule(WebModule object) {
return createWebModuleAdapter();
}
public Object caseJavaClientModule(JavaClientModule object) {
return createJavaClientModuleAdapter();
}
public Object caseEjbModule(EjbModule object) {
return createEjbModuleAdapter();
}
public Object caseConnectorModule(ConnectorModule object) {
return createConnectorModuleAdapter();
}
public Object caseJ2EEEObject(J2EEEObject object) {
return createJ2EEEObjectAdapter();
}
public Object caseDescriptionGroup(DescriptionGroup object) {
return createDescriptionGroupAdapter();
}
public Object caseCompatibilityDescriptionGroup(CompatibilityDescriptionGroup object) {
return createCompatibilityDescriptionGroupAdapter();
}
public Object caseApplication_Module(Module object) {
return createApplication_ModuleAdapter();
}
public Object defaultCase(EObject object) {
return createEObjectAdapter();
}
};
/**
* @generated This field/method will be replaced during code generation.
*/
public Adapter createAdapterGen(Notifier target) {
return (Adapter)modelSwitch.doSwitch((EObject)target);
}
/**
* By default create methods return null so that we can easily ignore cases.
* It's useful to ignore a case when inheritance will catch all the cases anyway.
*/
/**
* @generated This field/method will be replaced during code generation.
*/
public Adapter createApplicationAdapterGen() {
return null;
}
/**
* @generated This field/method will be replaced during code generation.
*/
public Adapter createModuleAdapterGen() {
return null;
}
/**
* @generated This field/method will be replaced during code generation.
*/
public Adapter createWebModuleAdapterGen() {
return null;
}
/**
* @generated This field/method will be replaced during code generation.
*/
public Adapter createJavaClientModuleAdapterGen() {
return null;
}
/**
* @generated This field/method will be replaced during code generation.
*/
public Adapter createEjbModuleAdapterGen() {
return null;
}
/**
* @generated This field/method will be replaced during code generation.
*/
public Adapter createConnectorModuleAdapterGen() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.jst.j2ee.common.J2EEEObject <em>J2EEE Object</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.jst.j2ee.common.J2EEEObject
* @generated
*/
public Adapter createJ2EEEObjectAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.jst.j2ee.common.DescriptionGroup <em>Description Group</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.jst.j2ee.common.DescriptionGroup
* @generated
*/
public Adapter createDescriptionGroupAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.jst.j2ee.common.CompatibilityDescriptionGroup <em>Compatibility Description Group</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.jst.j2ee.common.CompatibilityDescriptionGroup
* @generated
*/
public Adapter createCompatibilityDescriptionGroupAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.jst.j2ee.application.Module <em>Module</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.jst.j2ee.application.Module
* @generated
*/
public Adapter createApplication_ModuleAdapter() {
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;
}
} //ApplicationAdapterFactory