/******************************************************************************* * Copyright (c) 2010-2015 Henshin developers. 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: * TU Berlin, University of Luxembourg, SES S.A. *******************************************************************************/ /** */ package source.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 source.Association; import source.Attribute; import source.ClassDiagram; import source.PrimitiveDataType; import source.SourceFactory; import source.SourcePackage; /** * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. * <!-- end-user-doc --> * @generated */ public class SourceFactoryImpl extends EFactoryImpl implements SourceFactory { /** * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static SourceFactory init() { try { SourceFactory theSourceFactory = (SourceFactory)EPackage.Registry.INSTANCE.getEFactory(SourcePackage.eNS_URI); if (theSourceFactory != null) { return theSourceFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new SourceFactoryImpl(); } /** * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SourceFactoryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case SourcePackage.CLASS: return createClass(); case SourcePackage.ASSOCIATION: return createAssociation(); case SourcePackage.ATTRIBUTE: return createAttribute(); case SourcePackage.PRIMITIVE_DATA_TYPE: return createPrimitiveDataType(); case SourcePackage.CLASS_DIAGRAM: return createClassDiagram(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public source.Class createClass() { ClassImpl class_ = new ClassImpl(); return class_; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Association createAssociation() { AssociationImpl association = new AssociationImpl(); return association; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Attribute createAttribute() { AttributeImpl attribute = new AttributeImpl(); return attribute; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public PrimitiveDataType createPrimitiveDataType() { PrimitiveDataTypeImpl primitiveDataType = new PrimitiveDataTypeImpl(); return primitiveDataType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ClassDiagram createClassDiagram() { ClassDiagramImpl classDiagram = new ClassDiagramImpl(); return classDiagram; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SourcePackage getSourcePackage() { return (SourcePackage)getEPackage(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @deprecated * @generated */ @Deprecated public static SourcePackage getPackage() { return SourcePackage.eINSTANCE; } } //SourceFactoryImpl