/******************************************************************************* | |
* Copyright (c) 2016 Fundación Tecnalia Research & Innovation. | |
* | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v2.0 | |
* which accompanies this distribution, and is available at | |
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html | |
* | |
* SPDX-License-Identifier: EPL-2.0 | |
* | |
* Contributors: | |
* Huascar Espinoza - initial API and implementation | |
* Alejandra Ruíz - initial API and implementation | |
* Idoya Del Río - initial API and implementation | |
* Mari Carmen Palacios - initial API and implementation | |
* Angel López - initial API and implementation | |
*******************************************************************************/ | |
/** | |
*/ | |
package org.eclipse.opencert.apm.assuranceassets.assuranceasset.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.impl.EFactoryImpl; | |
import org.eclipse.emf.ecore.plugin.EcorePlugin; | |
import org.eclipse.opencert.apm.assuranceassets.assuranceasset.*; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model <b>Factory</b>. | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public class AssuranceassetFactoryImpl extends EFactoryImpl implements AssuranceassetFactory { | |
/** | |
* Creates the default factory implementation. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static AssuranceassetFactory init() { | |
try { | |
AssuranceassetFactory theAssuranceassetFactory = (AssuranceassetFactory)EPackage.Registry.INSTANCE.getEFactory(AssuranceassetPackage.eNS_URI); | |
if (theAssuranceassetFactory != null) { | |
return theAssuranceassetFactory; | |
} | |
} | |
catch (Exception exception) { | |
EcorePlugin.INSTANCE.log(exception); | |
} | |
return new AssuranceassetFactoryImpl(); | |
} | |
/** | |
* Creates an instance of the factory. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public AssuranceassetFactoryImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public EObject create(EClass eClass) { | |
switch (eClass.getClassifierID()) { | |
case AssuranceassetPackage.ASSURANCE_ASSETS_MODEL: return (EObject)createAssuranceAssetsModel(); | |
case AssuranceassetPackage.MANAGEABLE_ASSURANCE_ASSET: return (EObject)createManageableAssuranceAsset(); | |
case AssuranceassetPackage.ASSURANCE_ASSET_EVENT: return (EObject)createAssuranceAssetEvent(); | |
case AssuranceassetPackage.ASSURANCE_ASSET_EVALUATION: return (EObject)createAssuranceAssetEvaluation(); | |
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 AssuranceassetPackage.EVENT_KIND: | |
return createEventKindFromString(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 AssuranceassetPackage.EVENT_KIND: | |
return convertEventKindToString(eDataType, instanceValue); | |
default: | |
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); | |
} | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public AssuranceAssetsModel createAssuranceAssetsModel() { | |
AssuranceAssetsModelImpl assuranceAssetsModel = new AssuranceAssetsModelImpl(); | |
return assuranceAssetsModel; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public ManageableAssuranceAsset createManageableAssuranceAsset() { | |
ManageableAssuranceAssetImpl manageableAssuranceAsset = new ManageableAssuranceAssetImpl(); | |
return manageableAssuranceAsset; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public AssuranceAssetEvent createAssuranceAssetEvent() { | |
AssuranceAssetEventImpl assuranceAssetEvent = new AssuranceAssetEventImpl(); | |
return assuranceAssetEvent; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public AssuranceAssetEvaluation createAssuranceAssetEvaluation() { | |
AssuranceAssetEvaluationImpl assuranceAssetEvaluation = new AssuranceAssetEvaluationImpl(); | |
return assuranceAssetEvaluation; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EventKind createEventKindFromString(EDataType eDataType, String initialValue) { | |
EventKind result = EventKind.get(initialValue); | |
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); | |
return result; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String convertEventKindToString(EDataType eDataType, Object instanceValue) { | |
return instanceValue == null ? null : instanceValue.toString(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public AssuranceassetPackage getAssuranceassetPackage() { | |
return (AssuranceassetPackage)getEPackage(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @deprecated | |
* @generated | |
*/ | |
@Deprecated | |
public static AssuranceassetPackage getPackage() { | |
return AssuranceassetPackage.eINSTANCE; | |
} | |
} //AssuranceassetFactoryImpl |