/*
* Copyright (c) 2003- michael lawley and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation
* which accompanies this distribution, and is available by writing to
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* michael lawley
*
*
* $Id$
*/
package tefkat.config.TefkatConfig.impl;
import java.util.Map;
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 tefkat.config.TefkatConfig.*;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
* @generated
*/
public class TefkatConfigFactoryImpl extends EFactoryImpl implements TefkatConfigFactory {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = "Copyright michael lawley Pty Ltd 2004-2005";
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static TefkatConfigFactory init() {
try {
TefkatConfigFactory theTefkatConfigFactory = (TefkatConfigFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.dstc.edu.au:8080/qvt/TefkatConfig.ecore");
if (theTefkatConfigFactory != null) {
return theTefkatConfigFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new TefkatConfigFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TefkatConfigFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case TefkatConfigPackage.CONFIGURATION: return createConfiguration();
case TefkatConfigPackage.TRANSFORMATION_TASK: return createTransformationTask();
case TefkatConfigPackage.MODEL: return createModel();
case TefkatConfigPackage.URI_MAP_ENTRY: return (EObject)createURIMapEntry();
case TefkatConfigPackage.PROPERTY: return (EObject)createProperty();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object createFromString(EDataType eDataType, String initialValue) {
switch (eDataType.getClassifierID()) {
case TefkatConfigPackage.EXECUTION_MODE:
return createExecutionModeFromString(eDataType, initialValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String convertToString(EDataType eDataType, Object instanceValue) {
switch (eDataType.getClassifierID()) {
case TefkatConfigPackage.EXECUTION_MODE:
return convertExecutionModeToString(eDataType, instanceValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Configuration createConfiguration() {
ConfigurationImpl configuration = new ConfigurationImpl();
return configuration;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TransformationTask createTransformationTask() {
TransformationTaskImpl transformationTask = new TransformationTaskImpl();
return transformationTask;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Model createModel() {
ModelImpl model = new ModelImpl();
return model;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Map.Entry createURIMapEntry() {
URIMapEntryImpl uriMapEntry = new URIMapEntryImpl();
return uriMapEntry;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Map.Entry createProperty() {
PropertyImpl property = new PropertyImpl();
return property;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ExecutionMode createExecutionModeFromString(EDataType eDataType, String initialValue) {
ExecutionMode result = ExecutionMode.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 convertExecutionModeToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TefkatConfigPackage getTefkatConfigPackage() {
return (TefkatConfigPackage)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
public static TefkatConfigPackage getPackage() {
return TefkatConfigPackage.eINSTANCE;
}
} //TefkatConfigFactoryImpl