| /** |
| * Copyright (c) 2017 Christian W. Damus 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: |
| * Christian W. Damus - initial API and implementation |
| * |
| */ |
| package org.eclipse.papyrus.compare.uml2.tests.elements.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.papyrus.compare.uml2.tests.elements.*; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public class ElementsFactoryImpl extends EFactoryImpl implements ElementsFactory { |
| /** |
| * Creates the default factory implementation. <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public static ElementsFactory init() { |
| try { |
| ElementsFactory theElementsFactory = (ElementsFactory)EPackage.Registry.INSTANCE |
| .getEFactory(ElementsPackage.eNS_URI); |
| if (theElementsFactory != null) { |
| return theElementsFactory; |
| } |
| } catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new ElementsFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public ElementsFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case ElementsPackage.VIEWPOINT: |
| return createViewpoint(); |
| default: |
| throw new IllegalArgumentException( |
| "The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Viewpoint createViewpoint() { |
| ViewpointImpl viewpoint = new ViewpointImpl(); |
| return viewpoint; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public ElementsPackage getElementsPackage() { |
| return (ElementsPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static ElementsPackage getPackage() { |
| return ElementsPackage.eINSTANCE; |
| } |
| |
| } // ElementsFactoryImpl |