blob: 073d2fa4d808b6e8b88bcf74f539f47c6a8c9d92 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2007, 2010 BMW Car IT, Technische Universitaet Muenchen, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* BMW Car IT - Initial API and implementation
* Technische Universitaet Muenchen - Major refactoring and extension
*******************************************************************************/
package org.eclipse.emf.edapt.migration.test.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 org.eclipse.emf.edapt.migration.test.TestCaseDefinition;
import org.eclipse.emf.edapt.migration.test.TestFactory;
import org.eclipse.emf.edapt.migration.test.TestPackage;
import org.eclipse.emf.edapt.migration.test.TestSuiteDefinition;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
*
* @generated
*/
public class TestFactoryImpl extends EFactoryImpl implements TestFactory {
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public static TestFactory init() {
try {
final TestFactory theTestFactory = (TestFactory) EPackage.Registry.INSTANCE
.getEFactory("http://www.eclipse.org/emf/edapt/migration/test/0.3"); //$NON-NLS-1$
if (theTestFactory != null) {
return theTestFactory;
}
} catch (final Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new TestFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public TestFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case TestPackage.TEST_SUITE_DEFINITION:
return createTestSuiteDefinition();
case TestPackage.TEST_CASE_DEFINITION:
return createTestCaseDefinition();
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 TestSuiteDefinition createTestSuiteDefinition() {
final TestSuiteDefinitionImpl testSuiteDefinition = new TestSuiteDefinitionImpl();
return testSuiteDefinition;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public TestCaseDefinition createTestCaseDefinition() {
final TestCaseDefinitionImpl testCaseDefinition = new TestCaseDefinitionImpl();
return testCaseDefinition;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public TestPackage getTestPackage() {
return (TestPackage) getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @deprecated
* @generated
*/
@Deprecated
public static TestPackage getPackage() {
return TestPackage.eINSTANCE;
}
} // TestFactoryImpl