/** */ package robot.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 robot.*; /** * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. * <!-- end-user-doc --> * @generated */ public class RobotFactoryImpl extends EFactoryImpl implements RobotFactory { /** * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static RobotFactory init() { try { RobotFactory theRobotFactory = (RobotFactory)EPackage.Registry.INSTANCE.getEFactory(RobotPackage.eNS_URI); if (theRobotFactory != null) { return theRobotFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new RobotFactoryImpl(); } /** * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public RobotFactoryImpl() { 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 RobotPackage.DOUBLE: return createDoubleFromString(eDataType, initialValue); case RobotPackage.BOOL: return createBoolFromString(eDataType, initialValue); case RobotPackage.INT: return createIntFromString(eDataType, initialValue); case RobotPackage.STRING: return createStringFromString(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 RobotPackage.DOUBLE: return convertDoubleToString(eDataType, instanceValue); case RobotPackage.BOOL: return convertBoolToString(eDataType, instanceValue); case RobotPackage.INT: return convertIntToString(eDataType, instanceValue); case RobotPackage.STRING: return convertStringToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Double createDoubleFromString(EDataType eDataType, String initialValue) { return (Double)super.createFromString(eDataType, initialValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertDoubleToString(EDataType eDataType, Object instanceValue) { return super.convertToString(eDataType, instanceValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Boolean createBoolFromString(EDataType eDataType, String initialValue) { return (Boolean)super.createFromString(eDataType, initialValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertBoolToString(EDataType eDataType, Object instanceValue) { return super.convertToString(eDataType, instanceValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Integer createIntFromString(EDataType eDataType, String initialValue) { return (Integer)super.createFromString(eDataType, initialValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertIntToString(EDataType eDataType, Object instanceValue) { return super.convertToString(eDataType, instanceValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String createStringFromString(EDataType eDataType, String initialValue) { return (String)super.createFromString(eDataType, initialValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertStringToString(EDataType eDataType, Object instanceValue) { return super.convertToString(eDataType, instanceValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public RobotPackage getRobotPackage() { return (RobotPackage)getEPackage(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @deprecated * @generated */ @Deprecated public static RobotPackage getPackage() { return RobotPackage.eINSTANCE; } } //RobotFactoryImpl