/**
*/
package fr.obeo.intent.specification.impl;
import fr.obeo.intent.specification.*;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
* @generated
*/
public class SpecificationFactoryImpl extends EFactoryImpl implements SpecificationFactory {
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static SpecificationFactory init() {
try {
SpecificationFactory theSpecificationFactory = (SpecificationFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/intent/specification/1.0");
if (theSpecificationFactory != null) {
return theSpecificationFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new SpecificationFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SpecificationFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case SpecificationPackage.SPECIFICATION: return createSpecification();
case SpecificationPackage.FEATURE: return createFeature();
case SpecificationPackage.ROLE: return createRole();
case SpecificationPackage.CAPABILITY: return createCapability();
case SpecificationPackage.BENEFIT: return createBenefit();
case SpecificationPackage.STORY: return createStory();
case SpecificationPackage.SCENARIO: return createScenario();
case SpecificationPackage.CONTEXT: return createContext();
case SpecificationPackage.ACTION: return createAction();
case SpecificationPackage.BEHAVIOUR: return createBehaviour();
case SpecificationPackage.AUTOMATION_LAYER: return createAutomationLayer();
case SpecificationPackage.IMPLEMENTATION_NOTE: return createImplementationNote();
case SpecificationPackage.TEST_NOTE: return createTestNote();
case SpecificationPackage.TEST_GENERATION_NOTE: return createTestGenerationNote();
case SpecificationPackage.VALUE: return createValue();
case SpecificationPackage.PARAMETER: return createParameter();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object createFromString(EDataType eDataType, String initialValue) {
switch (eDataType.getClassifierID()) {
case SpecificationPackage.TEST_TYPE:
return createTestTypeFromString(eDataType, initialValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String convertToString(EDataType eDataType, Object instanceValue) {
switch (eDataType.getClassifierID()) {
case SpecificationPackage.TEST_TYPE:
return convertTestTypeToString(eDataType, instanceValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Specification createSpecification() {
SpecificationImpl specification = new SpecificationImpl();
return specification;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Feature createFeature() {
FeatureImpl feature = new FeatureImpl();
return feature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Role createRole() {
RoleImpl role = new RoleImpl();
return role;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Capability createCapability() {
CapabilityImpl capability = new CapabilityImpl();
return capability;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Benefit createBenefit() {
BenefitImpl benefit = new BenefitImpl();
return benefit;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Story createStory() {
StoryImpl story = new StoryImpl();
return story;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Scenario createScenario() {
ScenarioImpl scenario = new ScenarioImpl();
return scenario;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Context createContext() {
ContextImpl context = new ContextImpl();
return context;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Action createAction() {
ActionImpl action = new ActionImpl();
return action;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Behaviour createBehaviour() {
BehaviourImpl behaviour = new BehaviourImpl();
return behaviour;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public AutomationLayer createAutomationLayer() {
AutomationLayerImpl automationLayer = new AutomationLayerImpl();
return automationLayer;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ImplementationNote createImplementationNote() {
ImplementationNoteImpl implementationNote = new ImplementationNoteImpl();
return implementationNote;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TestNote createTestNote() {
TestNoteImpl testNote = new TestNoteImpl();
return testNote;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TestGenerationNote createTestGenerationNote() {
TestGenerationNoteImpl testGenerationNote = new TestGenerationNoteImpl();
return testGenerationNote;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Value createValue() {
ValueImpl value = new ValueImpl();
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Parameter createParameter() {
ParameterImpl parameter = new ParameterImpl();
return parameter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TestType createTestTypeFromString(EDataType eDataType, String initialValue) {
TestType result = TestType.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String convertTestTypeToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SpecificationPackage getSpecificationPackage() {
return (SpecificationPackage)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static SpecificationPackage getPackage() {
return SpecificationPackage.eINSTANCE;
}
} //SpecificationFactoryImpl