| /***************************************************************************** |
| * Copyright (c) 2009 CEA LIST. |
| * |
| * |
| * 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: |
| * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation |
| * |
| *****************************************************************************/ |
| package org.eclipse.papyrus.sysml.constraints.internal.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.sysml.constraints.ConstraintBlock; |
| import org.eclipse.papyrus.sysml.constraints.ConstraintProperty; |
| import org.eclipse.papyrus.sysml.constraints.ConstraintsFactory; |
| import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- |
| * end-user-doc --> |
| * |
| * @generated |
| */ |
| public class ConstraintsFactoryImpl extends EFactoryImpl implements ConstraintsFactory { |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static ConstraintsPackage getPackage() { |
| return ConstraintsPackage.eINSTANCE; |
| } |
| |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> <!-- |
| * end-user-doc --> |
| * |
| * @generated |
| */ |
| public static ConstraintsFactory init() { |
| try { |
| ConstraintsFactory theConstraintsFactory = (ConstraintsFactory) EPackage.Registry.INSTANCE.getEFactory(ConstraintsPackage.eNS_URI); |
| if (theConstraintsFactory != null) { |
| return theConstraintsFactory; |
| } |
| } catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new ConstraintsFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> <!-- |
| * end-user-doc --> |
| * |
| * @generated |
| */ |
| public ConstraintsFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case ConstraintsPackage.CONSTRAINT_BLOCK: |
| return createConstraintBlock(); |
| case ConstraintsPackage.CONSTRAINT_PROPERTY: |
| return createConstraintProperty(); |
| default: |
| throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public ConstraintBlock createConstraintBlock() { |
| ConstraintBlockImpl constraintBlock = new ConstraintBlockImpl(); |
| return constraintBlock; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public ConstraintProperty createConstraintProperty() { |
| ConstraintPropertyImpl constraintProperty = new ConstraintPropertyImpl(); |
| return constraintProperty; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public ConstraintsPackage getConstraintsPackage() { |
| return (ConstraintsPackage) getEPackage(); |
| } |
| |
| } // ConstraintsFactoryImpl |