/****************************************************************************** * Copyright (c) 2011-2013, Linagora * * 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 * * Contributors: * Linagora - initial API and implementation *******************************************************************************/ package com.ebmwebsourcing.petals.services.soap.soap.impl; import com.ebmwebsourcing.petals.services.soap.soap.*; 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 SoapFactoryImpl extends EFactoryImpl implements SoapFactory { /** * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static SoapFactory init() { try { SoapFactory theSoapFactory = (SoapFactory)EPackage.Registry.INSTANCE.getEFactory("http://petals.ow2.org/components/soap/version-4"); if (theSoapFactory != null) { return theSoapFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new SoapFactoryImpl(); } /** * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SoapFactoryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case SoapPackage.SOAP_PROVIDES: return createSoapProvides(); case SoapPackage.SOAP_CONSUMES: return createSoapConsumes(); case SoapPackage.SOAP_COMPONENT: return createSoapComponent(); 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 SoapPackage.SOAP_VERSION: return createSoapVersionFromString(eDataType, initialValue); case SoapPackage.SOAP_MODE: return createSoapModeFromString(eDataType, initialValue); case SoapPackage.COMPATIBILITY: return createCompatibilityFromString(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 SoapPackage.SOAP_VERSION: return convertSoapVersionToString(eDataType, instanceValue); case SoapPackage.SOAP_MODE: return convertSoapModeToString(eDataType, instanceValue); case SoapPackage.COMPATIBILITY: return convertCompatibilityToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SoapProvides createSoapProvides() { SoapProvidesImpl soapProvides = new SoapProvidesImpl(); return soapProvides; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SoapConsumes createSoapConsumes() { SoapConsumesImpl soapConsumes = new SoapConsumesImpl(); return soapConsumes; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SoapComponent createSoapComponent() { SoapComponentImpl soapComponent = new SoapComponentImpl(); return soapComponent; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SoapVersion createSoapVersionFromString(EDataType eDataType, String initialValue) { SoapVersion result = SoapVersion.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 convertSoapVersionToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SoapMode createSoapModeFromString(EDataType eDataType, String initialValue) { SoapMode result = SoapMode.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 convertSoapModeToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Compatibility createCompatibilityFromString(EDataType eDataType, String initialValue) { Compatibility result = Compatibility.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 convertCompatibilityToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SoapPackage getSoapPackage() { return (SoapPackage)getEPackage(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @deprecated * @generated */ @Deprecated public static SoapPackage getPackage() { return SoapPackage.eINSTANCE; } } //SoapFactoryImpl