/** * Copyright (c) 2014, 2015 Willink Transformations Ltd., University of York 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: * Adolfo Sanchez-Barbudo Herrera (University of York) - initial API and implementation */ package org.eclipse.ocl.pivot.internal.lookup.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.ocl.pivot.internal.lookup.*; import org.eclipse.ocl.pivot.internal.lookup.LookupFactory; import org.eclipse.ocl.pivot.internal.lookup.LookupPackage; /** * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. * <!-- end-user-doc --> * @generated */ public class LookupFactoryImpl extends EFactoryImpl implements LookupFactory { /** * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static LookupFactory init() { try { LookupFactory theLookupFactory = (LookupFactory)EPackage.Registry.INSTANCE.getEFactory(LookupPackage.eNS_URI); if (theLookupFactory != null) { return theLookupFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new LookupFactoryImpl(); } /** * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public LookupFactoryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case LookupPackage.LOOKUP_ENVIRONMENT: return createLookupEnvironment(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ } } /** * <!-- begin-user-doc --> * @since 1.1 * <!-- end-user-doc --> * @generated */ @Override public LookupEnvironment createLookupEnvironment() { LookupEnvironmentImpl lookupEnvironment = new LookupEnvironmentImpl(); return lookupEnvironment; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public LookupPackage getLookupPackage() { return (LookupPackage)getEPackage(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @deprecated * @generated */ @Deprecated public static LookupPackage getPackage() { return LookupPackage.eINSTANCE; } } //LookupFactoryImpl