| /******************************************************************************* |
| * Copyright (c) 2001, 2005 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.client.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.client.ApplicationClient; |
| import org.eclipse.jst.j2ee.client.ClientPackage; |
| import org.eclipse.jst.j2ee.common.CompatibilityDescriptionGroup; |
| import org.eclipse.jst.j2ee.common.DescriptionGroup; |
| |
| |
| |
| public class ClientAdapterFactory extends AdapterFactoryImpl { |
| protected static ClientPackage modelPackage; |
| |
| public ClientAdapterFactory() { |
| if (modelPackage == null) { |
| modelPackage = (ClientPackage)EPackage.Registry.INSTANCE.getEPackage(ClientPackage.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 ClientSwitch sw = new ClientSwitch() { |
| public Object caseApplicationClient(ApplicationClient object) { |
| return createApplicationClientAdapter(); |
| } |
| }; |
| |
| 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 createApplicationClientAdapter() { |
| 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 ClientSwitch modelSwitch = |
| new ClientSwitch() { |
| public Object caseApplicationClient(ApplicationClient object) { |
| return createApplicationClientAdapter(); |
| } |
| public Object caseDescriptionGroup(DescriptionGroup object) { |
| return createDescriptionGroupAdapter(); |
| } |
| public Object caseCompatibilityDescriptionGroup(CompatibilityDescriptionGroup object) { |
| return createCompatibilityDescriptionGroupAdapter(); |
| } |
| 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 createApplicationClientAdapterGen() { |
| |
| 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 the default case. |
| * <!-- begin-user-doc --> |
| * This default implementation returns null. |
| * <!-- end-user-doc --> |
| * @return the new adapter. |
| * @generated |
| */ |
| public Adapter createEObjectAdapter() { |
| return null; |
| } |
| |
| } //ClientAdapterFactory |
| |
| |