/*******************************************************************************
* Copyright (c) 2006-2013 The RCP Company and others.
* 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:
* The RCP Company - initial API and implementation
*******************************************************************************/
package com.rcpcompany.uibindings.scripting.internal;
import org.eclipse.emf.ecore.EClass;
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 com.rcpcompany.uibindings.scripting.IFeatureScript;
import com.rcpcompany.uibindings.scripting.IScriptingFactory;
import com.rcpcompany.uibindings.scripting.IScriptingPackage;
/**
* <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- end-user-doc -->
*
* @generated
*/
public class ScriptingFactoryImpl extends EFactoryImpl implements IScriptingFactory {
/**
* Creates the default factory implementation. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static IScriptingFactory init() {
try {
final IScriptingFactory theScriptingFactory = (IScriptingFactory) EPackage.Registry.INSTANCE
.getEFactory("http://rcp-company.com/schemas/uibindings/scripting.ecore");
if (theScriptingFactory != null) {
return theScriptingFactory;
}
} catch (final Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new ScriptingFactoryImpl();
}
/**
* Creates an instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public ScriptingFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case IScriptingPackage.FEATURE_SCRIPT:
return createFeatureScript();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public IFeatureScript createFeatureScript() {
final FeatureScriptImpl featureScript = new FeatureScriptImpl();
return featureScript;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public IScriptingPackage getScriptingPackage() {
return (IScriptingPackage) getEPackage();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @deprecated
* @generated
*/
@Deprecated
public static IScriptingPackage getPackage() {
return IScriptingPackage.eINSTANCE;
}
} // ScriptingFactoryImpl