| /******************************************************************************* |
| * Copyright (c) 2015 Willink Transformations 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: |
| * E.D.Willink - initial API and implementation |
| *******************************************************************************/ |
| /** |
| */ |
| package simpleuml2rdbms.uml.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 simpleuml2rdbms.uml.Association; |
| import simpleuml2rdbms.uml.Attribute; |
| import simpleuml2rdbms.uml.PrimitiveDataType; |
| import simpleuml2rdbms.uml.UMLFactory; |
| import simpleuml2rdbms.uml.UMLPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Factory</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class UMLFactoryImpl extends EFactoryImpl implements UMLFactory { |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static UMLFactory init() { |
| try { |
| UMLFactory theUMLFactory = (UMLFactory)EPackage.Registry.INSTANCE.getEFactory(UMLPackage.eNS_URI); |
| if (theUMLFactory != null) { |
| return theUMLFactory; |
| } |
| } |
| catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new UMLFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public UMLFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case UMLPackage.ATTRIBUTE: return createAttribute(); |
| case UMLPackage.ASSOCIATION: return createAssociation(); |
| case UMLPackage.CLASS: return createClass(); |
| case UMLPackage.PACKAGE: return createPackage(); |
| case UMLPackage.PRIMITIVE_DATA_TYPE: return createPrimitiveDataType(); |
| default: |
| throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Attribute createAttribute() { |
| AttributeImpl attribute = new AttributeImpl(); |
| return attribute; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Association createAssociation() { |
| AssociationImpl association = new AssociationImpl(); |
| return association; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public simpleuml2rdbms.uml.Class createClass() { |
| ClassImpl class_ = new ClassImpl(); |
| return class_; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public simpleuml2rdbms.uml.Package createPackage() { |
| PackageImpl package_ = new PackageImpl(); |
| return package_; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PrimitiveDataType createPrimitiveDataType() { |
| PrimitiveDataTypeImpl primitiveDataType = new PrimitiveDataTypeImpl(); |
| return primitiveDataType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public UMLPackage getUMLPackage() { |
| return (UMLPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static UMLPackage getPackage() { |
| return UMLPackage.eINSTANCE; |
| } |
| |
| } //UMLFactoryImpl |