| /******************************************************************************* |
| * CHESS core plugin |
| * |
| * Copyright (C) 2011-2015 |
| * Mälardalen University, Sweden |
| * |
| * |
| * 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 |
| *******************************************************************************/ |
| package org.polarsys.chess.fla.flamm.FailureTypes; |
| |
| 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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * The <b>Factory</b> for the model. |
| * It provides a create method for each non-abstract class of the model. |
| * <!-- end-user-doc --> |
| * @see org.polarsys.chess.fla.flamm.FailureTypes.FailureTypesPackage |
| * @generated |
| */ |
| public class FailureTypesFactory extends EFactoryImpl { |
| /** |
| * The singleton instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final FailureTypesFactory eINSTANCE = init(); |
| |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static FailureTypesFactory init() { |
| try { |
| FailureTypesFactory theFailureTypesFactory = (FailureTypesFactory)EPackage.Registry.INSTANCE.getEFactory(FailureTypesPackage.eNS_URI); |
| if (theFailureTypesFactory != null) { |
| return theFailureTypesFactory; |
| } |
| } |
| catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new FailureTypesFactory(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FailureTypesFactory() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| 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 FailureTypesPackage.FAILURE_TYPE: |
| return createFailureTypeFromString(eDataType, initialValue); |
| case FailureTypesPackage.AAVOIDABLE: |
| return createA_avoidableFromString(eDataType, initialValue); |
| case FailureTypesPackage.CAVOIDABLE: |
| return createC_avoidableFromString(eDataType, initialValue); |
| case FailureTypesPackage.IAVOIDABLE: |
| return createI_avoidableFromString(eDataType, initialValue); |
| case FailureTypesPackage.DAVOIDABLE: |
| return createD_avoidableFromString(eDataType, initialValue); |
| case FailureTypesPackage.AMITIGATION: |
| return createA_mitigationFromString(eDataType, initialValue); |
| case FailureTypesPackage.CMITIGATION: |
| return createC_mitigationFromString(eDataType, initialValue); |
| case FailureTypesPackage.IMITIGATION: |
| return createI_mitigationFromString(eDataType, initialValue); |
| case FailureTypesPackage.DMITIGATION: |
| return createD_mitigationFromString(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 FailureTypesPackage.FAILURE_TYPE: |
| return convertFailureTypeToString(eDataType, instanceValue); |
| case FailureTypesPackage.AAVOIDABLE: |
| return convertA_avoidableToString(eDataType, instanceValue); |
| case FailureTypesPackage.CAVOIDABLE: |
| return convertC_avoidableToString(eDataType, instanceValue); |
| case FailureTypesPackage.IAVOIDABLE: |
| return convertI_avoidableToString(eDataType, instanceValue); |
| case FailureTypesPackage.DAVOIDABLE: |
| return convertD_avoidableToString(eDataType, instanceValue); |
| case FailureTypesPackage.AMITIGATION: |
| return convertA_mitigationToString(eDataType, instanceValue); |
| case FailureTypesPackage.CMITIGATION: |
| return convertC_mitigationToString(eDataType, instanceValue); |
| case FailureTypesPackage.IMITIGATION: |
| return convertI_mitigationToString(eDataType, instanceValue); |
| case FailureTypesPackage.DMITIGATION: |
| return convertD_mitigationToString(eDataType, instanceValue); |
| default: |
| throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FailureType createFailureTypeFromString(EDataType eDataType, String initialValue) { |
| FailureType result = FailureType.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 convertFailureTypeToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public A_avoidable createA_avoidableFromString(EDataType eDataType, String initialValue) { |
| A_avoidable result = A_avoidable.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 convertA_avoidableToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public C_avoidable createC_avoidableFromString(EDataType eDataType, String initialValue) { |
| C_avoidable result = C_avoidable.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 convertC_avoidableToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public I_avoidable createI_avoidableFromString(EDataType eDataType, String initialValue) { |
| I_avoidable result = I_avoidable.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 convertI_avoidableToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public D_avoidable createD_avoidableFromString(EDataType eDataType, String initialValue) { |
| D_avoidable result = D_avoidable.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 convertD_avoidableToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public A_mitigation createA_mitigationFromString(EDataType eDataType, String initialValue) { |
| A_mitigation result = A_mitigation.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 convertA_mitigationToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public C_mitigation createC_mitigationFromString(EDataType eDataType, String initialValue) { |
| C_mitigation result = C_mitigation.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 convertC_mitigationToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public I_mitigation createI_mitigationFromString(EDataType eDataType, String initialValue) { |
| I_mitigation result = I_mitigation.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 convertI_mitigationToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public D_mitigation createD_mitigationFromString(EDataType eDataType, String initialValue) { |
| D_mitigation result = D_mitigation.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 convertD_mitigationToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FailureTypesPackage getFailureTypesPackage() { |
| return (FailureTypesPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static FailureTypesPackage getPackage() { |
| return FailureTypesPackage.eINSTANCE; |
| } |
| |
| } //FailureTypesFactory |