/** * This file is protected by Copyright. * Please refer to the COPYRIGHT file distributed with this source distribution. * * This file is part of REDHAWK IDE. * * 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. * */ // BEGIN GENERATED CODE package gov.redhawk.eclipsecorba.idl.operations.impl; import gov.redhawk.eclipsecorba.idl.operations.Attribute; import gov.redhawk.eclipsecorba.idl.operations.Direction; import gov.redhawk.eclipsecorba.idl.operations.Operation; import gov.redhawk.eclipsecorba.idl.operations.OperationsFactory; import gov.redhawk.eclipsecorba.idl.operations.OperationsPackage; import gov.redhawk.eclipsecorba.idl.operations.Parameter; 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>. * @since 6.0 * <!-- end-user-doc --> * @generated */ public class OperationsFactoryImpl extends EFactoryImpl implements OperationsFactory { /** * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static OperationsFactory init() { try { OperationsFactory theOperationsFactory = (OperationsFactory)EPackage.Registry.INSTANCE.getEFactory(OperationsPackage.eNS_URI); if (theOperationsFactory != null) { return theOperationsFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new OperationsFactoryImpl(); } /** * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public OperationsFactoryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case OperationsPackage.OPERATION: return createOperation(); case OperationsPackage.PARAMETER: return createParameter(); case OperationsPackage.ATTRIBUTE: return createAttribute(); 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 OperationsPackage.DIRECTION: return createDirectionFromString(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 OperationsPackage.DIRECTION: return convertDirectionToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Operation createOperation() { OperationImpl operation = new OperationImpl(); return operation; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Parameter createParameter() { ParameterImpl parameter = new ParameterImpl(); return parameter; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Attribute createAttribute() { AttributeImpl attribute = new AttributeImpl(); return attribute; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Direction createDirectionFromString(EDataType eDataType, String initialValue) { Direction result = Direction.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 convertDirectionToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public OperationsPackage getOperationsPackage() { return (OperationsPackage)getEPackage(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @deprecated * @generated */ @Deprecated public static OperationsPackage getPackage() { return OperationsPackage.eINSTANCE; } } //OperationsFactoryImpl