/** | |
* ******************************************************************************* | |
* Copyright (c) 2017 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.sca2amalthea.ir.scair.impl; | |
import org.eclipse.app4mc.sca2amalthea.ir.scair.*; | |
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 scairFactoryImpl extends EFactoryImpl implements scairFactory { | |
/** | |
* Creates the default factory implementation. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static scairFactory init() { | |
try { | |
scairFactory thescairFactory = (scairFactory)EPackage.Registry.INSTANCE.getEFactory(scairPackage.eNS_URI); | |
if (thescairFactory != null) { | |
return thescairFactory; | |
} | |
} | |
catch (Exception exception) { | |
EcorePlugin.INSTANCE.log(exception); | |
} | |
return new scairFactoryImpl(); | |
} | |
/** | |
* Creates an instance of the factory. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public scairFactoryImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public EObject create(EClass eClass) { | |
switch (eClass.getClassifierID()) { | |
case scairPackage.FUNCTION: return createFunction(); | |
case scairPackage.LABEL: return createLabel(); | |
case scairPackage.CALL_GRAPH: return createCallGraph(); | |
case scairPackage.CONTAINER: return createContainer(); | |
case scairPackage.PROJECT: return createProject(); | |
case scairPackage.LABEL_ACCESS: return createLabelAccess(); | |
case scairPackage.TYPE_DEF: return createTypeDef(); | |
case scairPackage.TYPE_DEF_MEMBER: return createTypeDefMember(); | |
case scairPackage.FUNCTION_CALL: return createFunctionCall(); | |
case scairPackage.IDENTIFIABLE_ELEMENT: return createIdentifiableElement(); | |
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 scairPackage.EFUNCTION_TYPE_ENUM: | |
return createEFunctionTypeEnumFromString(eDataType, initialValue); | |
case scairPackage.ACCESS_TYPE_ENUM: | |
return createAccessTypeEnumFromString(eDataType, initialValue); | |
case scairPackage.ETYPE_CATEGORY: | |
return createETypeCategoryFromString(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 scairPackage.EFUNCTION_TYPE_ENUM: | |
return convertEFunctionTypeEnumToString(eDataType, instanceValue); | |
case scairPackage.ACCESS_TYPE_ENUM: | |
return convertAccessTypeEnumToString(eDataType, instanceValue); | |
case scairPackage.ETYPE_CATEGORY: | |
return convertETypeCategoryToString(eDataType, instanceValue); | |
default: | |
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); | |
} | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Function createFunction() { | |
FunctionImpl function = new FunctionImpl(); | |
return function; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Label createLabel() { | |
LabelImpl label = new LabelImpl(); | |
return label; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public CallGraph createCallGraph() { | |
CallGraphImpl callGraph = new CallGraphImpl(); | |
return callGraph; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public org.eclipse.app4mc.sca2amalthea.ir.scair.Container createContainer() { | |
ContainerImpl container = new ContainerImpl(); | |
return container; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Project createProject() { | |
ProjectImpl project = new ProjectImpl(); | |
return project; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public LabelAccess createLabelAccess() { | |
LabelAccessImpl labelAccess = new LabelAccessImpl(); | |
return labelAccess; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public TypeDef createTypeDef() { | |
TypeDefImpl typeDef = new TypeDefImpl(); | |
return typeDef; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public TypeDefMember createTypeDefMember() { | |
TypeDefMemberImpl typeDefMember = new TypeDefMemberImpl(); | |
return typeDefMember; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public FunctionCall createFunctionCall() { | |
FunctionCallImpl functionCall = new FunctionCallImpl(); | |
return functionCall; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public IdentifiableElement createIdentifiableElement() { | |
IdentifiableElementImpl identifiableElement = new IdentifiableElementImpl(); | |
return identifiableElement; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EFunctionTypeEnum createEFunctionTypeEnumFromString(EDataType eDataType, String initialValue) { | |
EFunctionTypeEnum result = EFunctionTypeEnum.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 convertEFunctionTypeEnumToString(EDataType eDataType, Object instanceValue) { | |
return instanceValue == null ? null : instanceValue.toString(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public AccessTypeEnum createAccessTypeEnumFromString(EDataType eDataType, String initialValue) { | |
AccessTypeEnum result = AccessTypeEnum.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 convertAccessTypeEnumToString(EDataType eDataType, Object instanceValue) { | |
return instanceValue == null ? null : instanceValue.toString(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public ETypeCategory createETypeCategoryFromString(EDataType eDataType, String initialValue) { | |
ETypeCategory result = ETypeCategory.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 convertETypeCategoryToString(EDataType eDataType, Object instanceValue) { | |
return instanceValue == null ? null : instanceValue.toString(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public scairPackage getscairPackage() { | |
return (scairPackage)getEPackage(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @deprecated | |
* @generated | |
*/ | |
@Deprecated | |
public static scairPackage getPackage() { | |
return scairPackage.eINSTANCE; | |
} | |
} //scairFactoryImpl |