package org.eclipse.emf.texo.test.model.schemaconstructs.duration;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.texo.model.ModelFactory;
import org.eclipse.emf.texo.model.ModelPackage;
import org.eclipse.emf.texo.model.ModelResolver;
import org.eclipse.emf.texo.server.store.DaoRegistry;
import org.eclipse.emf.texo.test.model.base.identifiable.IdentifiableModelPackage;
import org.eclipse.emf.texo.test.model.schemaconstructs.duration.dao.DurationTestDao;
import org.eclipse.emf.texo.utils.ModelUtils;
/**
* The <b>Package</b> for the model '<em><b>duration</b></em>'. It contains initialization code and access to the
* Factory to instantiate types of this package.
*
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public class DurationModelPackage extends ModelPackage {
/**
* Is set when the package has been initialized.
*
* @generated
*/
private static boolean isInitialized = false;
/**
* The package namespace URI. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static final String NS_URI = "http://www.eclipse.org/emf/texo/test/model/schemaconstructs/duration";
/**
* The {@link ModelFactory} for this package. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static final DurationModelFactory MODELFACTORY = new DurationModelFactory();
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static final int DURATIONTEST_CLASSIFIER_ID = 0;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static final int DURATIONTEST_DB_ID_FEATURE_ID = 0;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static final int DURATIONTEST_DB_VERSION_FEATURE_ID = 1;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static final int DURATIONTEST_NAME_FEATURE_ID = 2;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static final int DURATIONTEST_DURATION_FEATURE_ID = 3;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static final int DURATIONTEST_DURATIONS_FEATURE_ID = 4;
/**
* The static member with the instance of this {@link ModelPackage}. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static final DurationModelPackage INSTANCE = initialize();
/**
* Initializes this {@link ModelPackage}. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return an initialized instance of this class
*
* @generated
*/
public static DurationModelPackage initialize() {
if (isInitialized) {
return (DurationModelPackage) ModelResolver.getInstance().getModelPackage(NS_URI);
}
final DurationModelPackage modelPackage = new DurationModelPackage();
ModelResolver.getInstance().registerModelPackage(modelPackage);
// read the model from the ecore file, the EPackage is registered in the EPackage.Registry
// see the ModelResolver getEPackageRegistry method
ModelUtils.readEPackagesFromFile(modelPackage);
isInitialized = true;
IdentifiableModelPackage.initialize();
// force the initialization of the EFactory proxy
modelPackage.getEPackage();
// register the relation between a Class and its EClassifier
ModelResolver.getInstance().registerClassModelMapping(DurationTest.class, modelPackage.getDurationTestEClass(),
modelPackage);
DaoRegistry.getInstance().registerDao(DurationTest.class, DurationTestDao.class);
// and return ourselves
return modelPackage;
}
/**
* Returns the {@link ModelFactory} of this ModelPackage. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return the {@link DurationModelFactory} instance.
* @generated
*/
@Override
public DurationModelFactory getModelFactory() {
return MODELFACTORY;
}
/**
* Returns the nsUri of the {@link EPackage} managed by this Package instance. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @return the nsUri of the EPackage
* @generated
*/
@Override
public String getNsURI() {
return NS_URI;
}
/**
* Returns the name of the ecore file containing the ecore model of the {@link EPackage} managed here. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @return the name of the ecore file
* @generated
*/
@Override
public String getEcoreFileName() {
return "duration.ecore";
}
/**
* Returns the {@link EClass} '<em><b>DurationTest</b></em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return an instance of the {@link EClass} '<em><b>DurationTest</b></em>'
* @generated
*/
public EClass getDurationTestEClass() {
return (EClass) getEPackage().getEClassifiers().get(DURATIONTEST_CLASSIFIER_ID);
}
/**
* Returns the {@link EStructuralFeature} '<em><b>DurationTest.name</b></em>'. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @return an instance of the {@link EStructuralFeature}: '<em><b>DurationTest.name</b></em>'.
* @generated
*/
public EAttribute getDurationTest_Name() {
return (EAttribute) getDurationTestEClass().getEAllStructuralFeatures().get(DURATIONTEST_NAME_FEATURE_ID);
}
/**
* Returns the {@link EStructuralFeature} '<em><b>DurationTest.duration</b></em>'. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @return an instance of the {@link EStructuralFeature}: '<em><b>DurationTest.duration</b></em>'.
* @generated
*/
public EAttribute getDurationTest_Duration() {
return (EAttribute) getDurationTestEClass().getEAllStructuralFeatures().get(DURATIONTEST_DURATION_FEATURE_ID);
}
/**
* Returns the {@link EStructuralFeature} '<em><b>DurationTest.durations</b></em>'. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @return an instance of the {@link EStructuralFeature}: '<em><b>DurationTest.durations</b></em>'.
* @generated
*/
public EAttribute getDurationTest_Durations() {
return (EAttribute) getDurationTestEClass().getEAllStructuralFeatures().get(DURATIONTEST_DURATIONS_FEATURE_ID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @param eClassifier
* the {@link EClassifier}
* @return the class implementing a specific {@link EClass}.
* @generated
*/
@Override
public Class<?> getEClassifierClass(EClassifier eClassifier) {
switch (eClassifier.getClassifierID()) {
case DURATIONTEST_CLASSIFIER_ID:
return DurationTest.class;
default:
throw new IllegalArgumentException("The EClassifier '" + eClassifier + "' is not defined in this EPackage");
}
}
}