| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Jose C. Dominguez - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.organizationdsl.impl; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EDataType; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EPackage; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.EFactoryImpl; |
| |
| import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| |
| import org.eclipse.osbp.xtext.organizationdsl.*; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Factory</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class OrganizationDSLFactoryImpl extends EFactoryImpl implements OrganizationDSLFactory { |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static OrganizationDSLFactory init() { |
| try { |
| OrganizationDSLFactory theOrganizationDSLFactory = (OrganizationDSLFactory)EPackage.Registry.INSTANCE.getEFactory(OrganizationDSLPackage.eNS_URI); |
| if (theOrganizationDSLFactory != null) { |
| return theOrganizationDSLFactory; |
| } |
| } |
| catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new OrganizationDSLFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OrganizationDSLFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case OrganizationDSLPackage.ORGANIZATION_MODEL: return createOrganizationModel(); |
| case OrganizationDSLPackage.ORGANIZATION_LAZY_RESOLVER: return createOrganizationLazyResolver(); |
| case OrganizationDSLPackage.ORGANIZATION_PACKAGE: return createOrganizationPackage(); |
| case OrganizationDSLPackage.ORGANIZATION_BASE: return createOrganizationBase(); |
| case OrganizationDSLPackage.ORGANIZATION: return createOrganization(); |
| case OrganizationDSLPackage.ORGANIZATION_POSITION: return createOrganizationPosition(); |
| case OrganizationDSLPackage.ORGANIZATION_SUPERIOR: return createOrganizationSuperior(); |
| case OrganizationDSLPackage.ORGANIZATION_ROLE: return createOrganizationRole(); |
| default: |
| throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object createFromString(EDataType eDataType, String initialValue) { |
| switch (eDataType.getClassifierID()) { |
| case OrganizationDSLPackage.INTERNAL_EOBJECT: |
| return createInternalEObjectFromString(eDataType, initialValue); |
| default: |
| throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String convertToString(EDataType eDataType, Object instanceValue) { |
| switch (eDataType.getClassifierID()) { |
| case OrganizationDSLPackage.INTERNAL_EOBJECT: |
| return convertInternalEObjectToString(eDataType, instanceValue); |
| default: |
| throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OrganizationModel createOrganizationModel() { |
| OrganizationModelImpl organizationModel = new OrganizationModelImpl(); |
| return organizationModel; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OrganizationLazyResolver createOrganizationLazyResolver() { |
| OrganizationLazyResolverImpl organizationLazyResolver = new OrganizationLazyResolverImpl(); |
| return organizationLazyResolver; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OrganizationPackage createOrganizationPackage() { |
| OrganizationPackageImpl organizationPackage = new OrganizationPackageImpl(); |
| return organizationPackage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OrganizationBase createOrganizationBase() { |
| OrganizationBaseImpl organizationBase = new OrganizationBaseImpl(); |
| return organizationBase; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Organization createOrganization() { |
| OrganizationImpl organization = new OrganizationImpl(); |
| return organization; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OrganizationPosition createOrganizationPosition() { |
| OrganizationPositionImpl organizationPosition = new OrganizationPositionImpl(); |
| return organizationPosition; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OrganizationSuperior createOrganizationSuperior() { |
| OrganizationSuperiorImpl organizationSuperior = new OrganizationSuperiorImpl(); |
| return organizationSuperior; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OrganizationRole createOrganizationRole() { |
| OrganizationRoleImpl organizationRole = new OrganizationRoleImpl(); |
| return organizationRole; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public InternalEObject createInternalEObjectFromString(EDataType eDataType, String initialValue) { |
| return (InternalEObject)super.createFromString(eDataType, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertInternalEObjectToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(eDataType, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OrganizationDSLPackage getOrganizationDSLPackage() { |
| return (OrganizationDSLPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static OrganizationDSLPackage getPackage() { |
| return OrganizationDSLPackage.eINSTANCE; |
| } |
| |
| } //OrganizationDSLFactoryImpl |