<reponame>rdubois/tcommon-studio-se<gh_stars>10-100
/**
 * <copyright> </copyright>
 * 
 * $Id$
 */
package orgomg.cwm.foundation.expressions.impl;

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 orgomg.cwm.foundation.expressions.*;
import orgomg.cwm.foundation.expressions.ConstantNode;
import orgomg.cwm.foundation.expressions.ElementNode;
import orgomg.cwm.foundation.expressions.ExpressionNode;
import orgomg.cwm.foundation.expressions.ExpressionsFactory;
import orgomg.cwm.foundation.expressions.ExpressionsPackage;
import orgomg.cwm.foundation.expressions.FeatureNode;

/**
 * <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!--
 * end-user-doc -->
 * @generated
 */
public class ExpressionsFactoryImpl extends EFactoryImpl implements ExpressionsFactory {

    /**
     * Creates the default factory implementation.
     * <!-- begin-user-doc --> <!--
     * end-user-doc -->
     * @generated
     */
    public static ExpressionsFactory init() {
        try {
            ExpressionsFactory theExpressionsFactory = (ExpressionsFactory) EPackage.Registry.INSTANCE
                    .getEFactory("http:///orgomg/cwm/foundation/expressions.ecore");
            if (theExpressionsFactory != null) {
                return theExpressionsFactory;
            }
        } catch (Exception exception) {
            EcorePlugin.INSTANCE.log(exception);
        }
        return new ExpressionsFactoryImpl();
    }

    /**
     * Creates an instance of the factory.
     * <!-- begin-user-doc --> <!--
     * end-user-doc -->
     * @generated
     */
    public ExpressionsFactoryImpl() {
        super();
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    @Override
    public EObject create(EClass eClass) {
        switch (eClass.getClassifierID()) {
        case ExpressionsPackage.EXPRESSION_NODE:
            return createExpressionNode();
        case ExpressionsPackage.CONSTANT_NODE:
            return createConstantNode();
        case ExpressionsPackage.ELEMENT_NODE:
            return createElementNode();
        case ExpressionsPackage.FEATURE_NODE:
            return createFeatureNode();
        default:
            throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
        }
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public ExpressionNode createExpressionNode() {
        ExpressionNodeImpl expressionNode = new ExpressionNodeImpl();
        return expressionNode;
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public ConstantNode createConstantNode() {
        ConstantNodeImpl constantNode = new ConstantNodeImpl();
        return constantNode;
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public ElementNode createElementNode() {
        ElementNodeImpl elementNode = new ElementNodeImpl();
        return elementNode;
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public FeatureNode createFeatureNode() {
        FeatureNodeImpl featureNode = new FeatureNodeImpl();
        return featureNode;
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public ExpressionsPackage getExpressionsPackage() {
        return (ExpressionsPackage) getEPackage();
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @deprecated
     * @generated
     */
    @Deprecated
    public static ExpressionsPackage getPackage() {
        return ExpressionsPackage.eINSTANCE;
    }

} // ExpressionsFactoryImpl
