/******************************************************************************* | |
* Copyright (c) 2014 Hussein Mhanna | |
* | |
* 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: | |
* Hussein Mhanna - initial API and implementation | |
******************************************************************************/ | |
package org.eclipse.rmf.reqif10.csv.importer.mapping.impl; | |
import org.eclipse.emf.ecore.EAttribute; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.EEnum; | |
import org.eclipse.emf.ecore.EPackage; | |
import org.eclipse.emf.ecore.EReference; | |
import org.eclipse.emf.ecore.impl.EPackageImpl; | |
import org.eclipse.rmf.reqif10.csv.importer.mapping.DataType; | |
import org.eclipse.rmf.reqif10.csv.importer.mapping.MappingFactory; | |
import org.eclipse.rmf.reqif10.csv.importer.mapping.MappingItem; | |
import org.eclipse.rmf.reqif10.csv.importer.mapping.MappingLibrary; | |
import org.eclipse.rmf.reqif10.csv.importer.mapping.MappingPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model <b>Package</b>. | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public class MappingPackageImpl extends EPackageImpl implements MappingPackage { | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass mappingItemEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass mappingLibraryEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EEnum dataTypeEEnum = null; | |
/** | |
* Creates an instance of the model <b>Package</b>, registered with | |
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package | |
* package URI value. | |
* <p>Note: the correct way to create the package is via the static | |
* factory method {@link #init init()}, which also performs | |
* initialization of the package, or returns the registered package, | |
* if one already exists. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see org.eclipse.emf.ecore.EPackage.Registry | |
* @see org.eclipse.rmf.reqif10.csv.importer.mapping.MappingPackage#eNS_URI | |
* @see #init() | |
* @generated | |
*/ | |
private MappingPackageImpl() { | |
super(eNS_URI, MappingFactory.eINSTANCE); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private static boolean isInited = false; | |
/** | |
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. | |
* | |
* <p>This method is used to initialize {@link MappingPackage#eINSTANCE} when that field is accessed. | |
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #eNS_URI | |
* @see #createPackageContents() | |
* @see #initializePackageContents() | |
* @generated | |
*/ | |
public static MappingPackage init() { | |
if (isInited) return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI); | |
// Obtain or create and register package | |
MappingPackageImpl theMappingPackage = (MappingPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof MappingPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new MappingPackageImpl()); | |
isInited = true; | |
// Create package meta-data objects | |
theMappingPackage.createPackageContents(); | |
// Initialize created meta-data | |
theMappingPackage.initializePackageContents(); | |
// Mark meta-data to indicate it can't be changed | |
theMappingPackage.freeze(); | |
// Update the registry and return the package | |
EPackage.Registry.INSTANCE.put(MappingPackage.eNS_URI, theMappingPackage); | |
return theMappingPackage; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getMappingItem() { | |
return mappingItemEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getMappingItem_AttributeName() { | |
return (EAttribute)mappingItemEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getMappingItem_DataType() { | |
return (EAttribute)mappingItemEClass.getEStructuralFeatures().get(1); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getMappingItem_ColumnId() { | |
return (EAttribute)mappingItemEClass.getEStructuralFeatures().get(2); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getMappingLibrary() { | |
return mappingLibraryEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getMappingLibrary_Items() { | |
return (EReference)mappingLibraryEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EEnum getDataType() { | |
return dataTypeEEnum; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public MappingFactory getMappingFactory() { | |
return (MappingFactory)getEFactoryInstance(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private boolean isCreated = false; | |
/** | |
* Creates the meta-model objects for the package. This method is | |
* guarded to have no affect on any invocation but its first. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void createPackageContents() { | |
if (isCreated) return; | |
isCreated = true; | |
// Create classes and their features | |
mappingItemEClass = createEClass(MAPPING_ITEM); | |
createEAttribute(mappingItemEClass, MAPPING_ITEM__ATTRIBUTE_NAME); | |
createEAttribute(mappingItemEClass, MAPPING_ITEM__DATA_TYPE); | |
createEAttribute(mappingItemEClass, MAPPING_ITEM__COLUMN_ID); | |
mappingLibraryEClass = createEClass(MAPPING_LIBRARY); | |
createEReference(mappingLibraryEClass, MAPPING_LIBRARY__ITEMS); | |
// Create enums | |
dataTypeEEnum = createEEnum(DATA_TYPE); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private boolean isInitialized = false; | |
/** | |
* Complete the initialization of the package and its meta-model. This | |
* method is guarded to have no affect on any invocation but its first. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void initializePackageContents() { | |
if (isInitialized) return; | |
isInitialized = true; | |
// Initialize package | |
setName(eNAME); | |
setNsPrefix(eNS_PREFIX); | |
setNsURI(eNS_URI); | |
// Create type parameters | |
// Set bounds for type parameters | |
// Add supertypes to classes | |
// Initialize classes, features, and operations; add parameters | |
initEClass(mappingItemEClass, MappingItem.class, "MappingItem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | |
initEAttribute(getMappingItem_AttributeName(), ecorePackage.getEString(), "attributeName", "", 1, 1, MappingItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEAttribute(getMappingItem_DataType(), this.getDataType(), "dataType", null, 1, 1, MappingItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEAttribute(getMappingItem_ColumnId(), ecorePackage.getEString(), "columnId", "", 1, 1, MappingItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEClass(mappingLibraryEClass, MappingLibrary.class, "MappingLibrary", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | |
initEReference(getMappingLibrary_Items(), this.getMappingItem(), null, "items", null, 0, -1, MappingLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
// Initialize enums and add enum literals | |
initEEnum(dataTypeEEnum, DataType.class, "DataType"); | |
addEEnumLiteral(dataTypeEEnum, DataType.STRING); | |
addEEnumLiteral(dataTypeEEnum, DataType.BOOLEAN); | |
addEEnumLiteral(dataTypeEEnum, DataType.INTEGER); | |
addEEnumLiteral(dataTypeEEnum, DataType.REAL); | |
addEEnumLiteral(dataTypeEEnum, DataType.DATE); | |
addEEnumLiteral(dataTypeEEnum, DataType.ENUMERATION); | |
addEEnumLiteral(dataTypeEEnum, DataType.XHTML); | |
// Create resource | |
createResource(eNS_URI); | |
} | |
} //MappingPackageImpl |