/*******************************************************************************
* Copyright (c) 2007 Borland Software Corporation 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:
* Borland Software Corporation - initial API and implementation
*******************************************************************************/
package rdb.constraints.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 rdb.constraints.CheckConstraint;
import rdb.constraints.ConstraintsFactory;
import rdb.constraints.ConstraintsPackage;
import rdb.constraints.ForeignKey;
import rdb.constraints.Index;
import rdb.constraints.IndexedColumn;
import rdb.constraints.PrimaryKey;
import rdb.constraints.UniqueConstraint;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
* @generated
*/
public class ConstraintsFactoryImpl extends EFactoryImpl implements ConstraintsFactory {
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static ConstraintsFactory init() {
try {
ConstraintsFactory theConstraintsFactory = (ConstraintsFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/qvt/1.0.0/Operational/examples/rdb/constraints"); //$NON-NLS-1$
if (theConstraintsFactory != null) {
return theConstraintsFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new ConstraintsFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ConstraintsFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case ConstraintsPackage.CHECK_CONSTRAINT: return createCheckConstraint();
case ConstraintsPackage.UNIQUE_CONSTRAINT: return createUniqueConstraint();
case ConstraintsPackage.PRIMARY_KEY: return createPrimaryKey();
case ConstraintsPackage.FOREIGN_KEY: return createForeignKey();
case ConstraintsPackage.INDEX: return createIndex();
case ConstraintsPackage.INDEXED_COLUMN: return createIndexedColumn();
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
*/
public CheckConstraint createCheckConstraint() {
CheckConstraintImpl checkConstraint = new CheckConstraintImpl();
return checkConstraint;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public UniqueConstraint createUniqueConstraint() {
UniqueConstraintImpl uniqueConstraint = new UniqueConstraintImpl();
return uniqueConstraint;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PrimaryKey createPrimaryKey() {
PrimaryKeyImpl primaryKey = new PrimaryKeyImpl();
return primaryKey;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ForeignKey createForeignKey() {
ForeignKeyImpl foreignKey = new ForeignKeyImpl();
return foreignKey;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Index createIndex() {
IndexImpl index = new IndexImpl();
return index;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IndexedColumn createIndexedColumn() {
IndexedColumnImpl indexedColumn = new IndexedColumnImpl();
return indexedColumn;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ConstraintsPackage getConstraintsPackage() {
return (ConstraintsPackage)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static ConstraintsPackage getPackage() {
return ConstraintsPackage.eINSTANCE;
}
} //ConstraintsFactoryImpl