/** * Copyright (c) 2007 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 - Initial API and implementation */ package org.eclipse.emf.test.models.key.impl; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; import org.eclipse.emf.test.models.key.Item; import org.eclipse.emf.test.models.key.KeyFactory; import org.eclipse.emf.test.models.key.KeyPackage; import org.eclipse.emf.test.models.key.Root; /** * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. * <!-- end-user-doc --> * @generated */ public class KeyFactoryImpl extends EFactoryImpl implements KeyFactory { /** * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static KeyFactory init() { try { KeyFactory theKeyFactory = (KeyFactory)EPackage.Registry.INSTANCE.getEFactory(KeyPackage.eNS_URI); if (theKeyFactory != null) { return theKeyFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new KeyFactoryImpl(); } /** * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public KeyFactoryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case KeyPackage.ITEM: return createItem(); case KeyPackage.ROOT: return createRoot(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Item createItem() { ItemImpl item = new ItemImpl(); return item; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Root createRoot() { RootImpl root = new RootImpl(); return root; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public KeyPackage getKeyPackage() { return (KeyPackage)getEPackage(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @deprecated * @generated */ @Deprecated public static KeyPackage getPackage() { return KeyPackage.eINSTANCE; } } //KeyFactoryImpl