blob: e78d7b74766feaf58fb3b58d10240d1f83bcbb79 [file] [log] [blame]
/**
* *******************************************************************************
* Copyright (c) 2020 Robert Bosch GmbH and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Generated using Eclipse EMF
*
* *******************************************************************************
*/
package org.eclipse.app4mc.slg.config.impl;
import org.eclipse.app4mc.slg.config.*;
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 -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
* @generated
*/
public class ConfigurationFactoryImpl extends EFactoryImpl implements ConfigurationFactory {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = "*******************************************************************************\n Copyright (c) 2020 Robert Bosch GmbH and others.\n\n This program and the accompanying materials are made\n available under the terms of the Eclipse Public License 2.0\n which is available at https://www.eclipse.org/legal/epl-2.0/\n\n SPDX-License-Identifier: EPL-2.0\n\n Generated using Eclipse EMF\n\n*******************************************************************************";
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static ConfigurationFactory init() {
try {
ConfigurationFactory theConfigurationFactory = (ConfigurationFactory)EPackage.Registry.INSTANCE.getEFactory(ConfigurationPackage.eNS_URI);
if (theConfigurationFactory != null) {
return theConfigurationFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new ConfigurationFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ConfigurationFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case ConfigurationPackage.CONFIG_MODEL: return createConfigModel();
case ConfigurationPackage.CUSTOM_IMPL: return createCustomImpl();
case ConfigurationPackage.CUSTOM_TICK_IMPL: return createCustomTickImpl();
case ConfigurationPackage.CUSTOM_READ_IMPL: return createCustomReadImpl();
case ConfigurationPackage.CUSTOM_WRITE_IMPL: return createCustomWriteImpl();
case ConfigurationPackage.CODE_HOOKS: return createCodeHooks();
case ConfigurationPackage.LIB_LOCATIONS: return createLibLocations();
case ConfigurationPackage.HEADER_FILES: return createHeaderFiles();
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 ConfigurationPackage.FILE_TYPE:
return createFileTypeFromString(eDataType, initialValue);
case ConfigurationPackage.TICK_TYPE:
return createTickTypeFromString(eDataType, initialValue);
case ConfigurationPackage.PLATFORM_ARCHITECTURE:
return createPlatformArchitectureFromString(eDataType, initialValue);
case ConfigurationPackage.CODEHOOK_TYPE:
return createCodehookTypeFromString(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 ConfigurationPackage.FILE_TYPE:
return convertFileTypeToString(eDataType, instanceValue);
case ConfigurationPackage.TICK_TYPE:
return convertTickTypeToString(eDataType, instanceValue);
case ConfigurationPackage.PLATFORM_ARCHITECTURE:
return convertPlatformArchitectureToString(eDataType, instanceValue);
case ConfigurationPackage.CODEHOOK_TYPE:
return convertCodehookTypeToString(eDataType, instanceValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ConfigModel createConfigModel() {
ConfigModelImpl configModel = new ConfigModelImpl();
return configModel;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public CustomImpl createCustomImpl() {
CustomImplImpl customImpl = new CustomImplImpl();
return customImpl;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public CustomTickImpl createCustomTickImpl() {
CustomTickImplImpl customTickImpl = new CustomTickImplImpl();
return customTickImpl;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public CustomReadImpl createCustomReadImpl() {
CustomReadImplImpl customReadImpl = new CustomReadImplImpl();
return customReadImpl;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public CustomWriteImpl createCustomWriteImpl() {
CustomWriteImplImpl customWriteImpl = new CustomWriteImplImpl();
return customWriteImpl;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public CodeHooks createCodeHooks() {
CodeHooksImpl codeHooks = new CodeHooksImpl();
return codeHooks;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public LibLocations createLibLocations() {
LibLocationsImpl libLocations = new LibLocationsImpl();
return libLocations;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public HeaderFiles createHeaderFiles() {
HeaderFilesImpl headerFiles = new HeaderFilesImpl();
return headerFiles;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FileType createFileTypeFromString(EDataType eDataType, String initialValue) {
FileType result = FileType.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 convertFileTypeToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TickType createTickTypeFromString(EDataType eDataType, String initialValue) {
TickType result = TickType.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 convertTickTypeToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PlatformArchitecture createPlatformArchitectureFromString(EDataType eDataType, String initialValue) {
PlatformArchitecture result = PlatformArchitecture.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 convertPlatformArchitectureToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodehookType createCodehookTypeFromString(EDataType eDataType, String initialValue) {
CodehookType result = CodehookType.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 convertCodehookTypeToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ConfigurationPackage getConfigurationPackage() {
return (ConfigurationPackage)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static ConfigurationPackage getPackage() {
return ConfigurationPackage.eINSTANCE;
}
} //ConfigurationFactoryImpl