blob: f6005db77dc8988ad1976a9f9a85dfae50ace412 [file] [log] [blame]
/**
* Copyright (c) 2009 Mia-Software.
* 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:
* Frederic Madiot (Mia-Software) - meta-model design
* Gregoire DUPE (Mia-Software) - design and implementation
*
*
* $Id$
*/
package org.eclipse.gmt.modisco.infra.query.runtime.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 org.eclipse.gmt.modisco.infra.query.runtime.*;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
* @generated
* @deprecated replaced by EMF Facet, cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=470578
*/
@Deprecated
public class RuntimeFactoryImpl extends EFactoryImpl implements RuntimeFactory {
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static RuntimeFactory init() {
try {
RuntimeFactory theRuntimeFactory = (RuntimeFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/MoDisco/infra/properties/query/runtime/0.8.unstable"); //$NON-NLS-1$
if (theRuntimeFactory != null) {
return theRuntimeFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new RuntimeFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RuntimeFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case RuntimePackage.MODEL_QUERY_CONTEXT: return createModelQueryContext();
case RuntimePackage.MODEL_QUERY_PARAMETER_VALUE: return createModelQueryParameterValue();
case RuntimePackage.MODEL_QUERY_RESULT: return createModelQueryResult();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object createFromString(EDataType eDataType, String initialValue) {
switch (eDataType.getClassifierID()) {
case RuntimePackage.JAVA_EXCEPTION:
return createJavaExceptionFromString(eDataType, initialValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String convertToString(EDataType eDataType, Object instanceValue) {
switch (eDataType.getClassifierID()) {
case RuntimePackage.JAVA_EXCEPTION:
return convertJavaExceptionToString(eDataType, instanceValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ModelQueryContext createModelQueryContext() {
ModelQueryContextImpl modelQueryContext = new ModelQueryContextImpl();
return modelQueryContext;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ModelQueryParameterValue createModelQueryParameterValue() {
ModelQueryParameterValueImpl modelQueryParameterValue = new ModelQueryParameterValueImpl();
return modelQueryParameterValue;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ModelQueryResult createModelQueryResult() {
ModelQueryResultImpl modelQueryResult = new ModelQueryResultImpl();
return modelQueryResult;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Exception createJavaExceptionFromString(EDataType eDataType, String initialValue) {
return (Exception)super.createFromString(eDataType, initialValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String convertJavaExceptionToString(EDataType eDataType, Object instanceValue) {
return super.convertToString(eDataType, instanceValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RuntimePackage getRuntimePackage() {
return (RuntimePackage)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static RuntimePackage getPackage() {
return RuntimePackage.eINSTANCE;
}
} //RuntimeFactoryImpl