| /******************************************************************************* |
| * Copyright (c) 2008-2011 Chair for Applied Software Engineering, |
| * Technische Universitaet Muenchen. |
| * 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: |
| ******************************************************************************/ |
| package org.eclipse.emf.emfstore.internal.common.model.impl; |
| |
| import java.util.Map; |
| |
| 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.emf.emfstore.internal.common.model.AssociationClassElement; |
| import org.eclipse.emf.emfstore.internal.common.model.EMFStoreProperty; |
| import org.eclipse.emf.emfstore.internal.common.model.EMFStorePropertyType; |
| import org.eclipse.emf.emfstore.internal.common.model.IdentifiableElement; |
| import org.eclipse.emf.emfstore.internal.common.model.ModelElementId; |
| import org.eclipse.emf.emfstore.internal.common.model.ModelFactory; |
| import org.eclipse.emf.emfstore.internal.common.model.ModelPackage; |
| import org.eclipse.emf.emfstore.internal.common.model.ModelVersion; |
| import org.eclipse.emf.emfstore.internal.common.model.NonDomainElement; |
| import org.eclipse.emf.emfstore.internal.common.model.Project; |
| import org.eclipse.emf.emfstore.internal.common.model.PropertyStringValue; |
| import org.eclipse.emf.emfstore.internal.common.model.UniqueIdentifier; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Package</b>. |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public class ModelPackageImpl extends EPackageImpl implements ModelPackage { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass projectEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass uniqueIdentifierEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass identifiableElementEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass modelElementIdEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass modelVersionEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass nonDomainElementEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass associationClassElementEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass emfStorePropertyEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass propertyMapEntryEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass propertyStringValueEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EEnum emfStorePropertyTypeEEnum = 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.emf.emfstore.internal.common.model.ModelPackage#eNS_URI |
| * @see #init() |
| * @generated |
| */ |
| private ModelPackageImpl() { |
| super(eNS_URI, ModelFactory.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 ModelPackage#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 ModelPackage init() { |
| if (isInited) |
| return (ModelPackage) EPackage.Registry.INSTANCE.getEPackage(ModelPackage.eNS_URI); |
| |
| // Obtain or create and register package |
| ModelPackageImpl theModelPackage = (ModelPackageImpl) (EPackage.Registry.INSTANCE |
| .get(eNS_URI) instanceof ModelPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) |
| : new ModelPackageImpl()); |
| |
| isInited = true; |
| |
| // Create package meta-data objects |
| theModelPackage.createPackageContents(); |
| |
| // Initialize created meta-data |
| theModelPackage.initializePackageContents(); |
| |
| // Mark meta-data to indicate it can't be changed |
| theModelPackage.freeze(); |
| |
| // Update the registry and return the package |
| EPackage.Registry.INSTANCE.put(ModelPackage.eNS_URI, theModelPackage); |
| return theModelPackage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EClass getProject() { |
| return projectEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EReference getProject_ModelElements() { |
| return (EReference) projectEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EReference getProject_CutElements() { |
| return (EReference) projectEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EClass getUniqueIdentifier() { |
| return uniqueIdentifierEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EAttribute getUniqueIdentifier_Id() { |
| return (EAttribute) uniqueIdentifierEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EClass getIdentifiableElement() { |
| return identifiableElementEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EAttribute getIdentifiableElement_Identifier() { |
| return (EAttribute) identifiableElementEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EClass getModelElementId() { |
| return modelElementIdEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EClass getModelVersion() { |
| return modelVersionEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EAttribute getModelVersion_ReleaseNumber() { |
| return (EAttribute) modelVersionEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EClass getNonDomainElement() { |
| return nonDomainElementEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EClass getAssociationClassElement() { |
| return associationClassElementEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EClass getEMFStoreProperty() { |
| return emfStorePropertyEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EAttribute getEMFStoreProperty_Key() { |
| return (EAttribute) emfStorePropertyEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EReference getEMFStoreProperty_Value() { |
| return (EReference) emfStorePropertyEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EAttribute getEMFStoreProperty_Type() { |
| return (EAttribute) emfStorePropertyEClass.getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EAttribute getEMFStoreProperty_Version() { |
| return (EAttribute) emfStorePropertyEClass.getEStructuralFeatures().get(3); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EClass getPropertyMapEntry() { |
| return propertyMapEntryEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EAttribute getPropertyMapEntry_Key() { |
| return (EAttribute) propertyMapEntryEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EReference getPropertyMapEntry_Value() { |
| return (EReference) propertyMapEntryEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EClass getPropertyStringValue() { |
| return propertyStringValueEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EAttribute getPropertyStringValue_Value() { |
| return (EAttribute) propertyStringValueEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EEnum getEMFStorePropertyType() { |
| return emfStorePropertyTypeEEnum; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public ModelFactory getModelFactory() { |
| return (ModelFactory) 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 |
| projectEClass = createEClass(PROJECT); |
| createEReference(projectEClass, PROJECT__MODEL_ELEMENTS); |
| createEReference(projectEClass, PROJECT__CUT_ELEMENTS); |
| |
| uniqueIdentifierEClass = createEClass(UNIQUE_IDENTIFIER); |
| createEAttribute(uniqueIdentifierEClass, UNIQUE_IDENTIFIER__ID); |
| |
| identifiableElementEClass = createEClass(IDENTIFIABLE_ELEMENT); |
| createEAttribute(identifiableElementEClass, IDENTIFIABLE_ELEMENT__IDENTIFIER); |
| |
| modelElementIdEClass = createEClass(MODEL_ELEMENT_ID); |
| |
| modelVersionEClass = createEClass(MODEL_VERSION); |
| createEAttribute(modelVersionEClass, MODEL_VERSION__RELEASE_NUMBER); |
| |
| nonDomainElementEClass = createEClass(NON_DOMAIN_ELEMENT); |
| |
| associationClassElementEClass = createEClass(ASSOCIATION_CLASS_ELEMENT); |
| |
| emfStorePropertyEClass = createEClass(EMF_STORE_PROPERTY); |
| createEAttribute(emfStorePropertyEClass, EMF_STORE_PROPERTY__KEY); |
| createEReference(emfStorePropertyEClass, EMF_STORE_PROPERTY__VALUE); |
| createEAttribute(emfStorePropertyEClass, EMF_STORE_PROPERTY__TYPE); |
| createEAttribute(emfStorePropertyEClass, EMF_STORE_PROPERTY__VERSION); |
| |
| propertyMapEntryEClass = createEClass(PROPERTY_MAP_ENTRY); |
| createEAttribute(propertyMapEntryEClass, PROPERTY_MAP_ENTRY__KEY); |
| createEReference(propertyMapEntryEClass, PROPERTY_MAP_ENTRY__VALUE); |
| |
| propertyStringValueEClass = createEClass(PROPERTY_STRING_VALUE); |
| createEAttribute(propertyStringValueEClass, PROPERTY_STRING_VALUE__VALUE); |
| |
| // Create enums |
| emfStorePropertyTypeEEnum = createEEnum(EMF_STORE_PROPERTY_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 |
| modelElementIdEClass.getESuperTypes().add(this.getUniqueIdentifier()); |
| propertyStringValueEClass.getESuperTypes().add(ecorePackage.getEObject()); |
| |
| // Initialize classes and features; add operations and parameters |
| initEClass(projectEClass, Project.class, "Project", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ |
| initEReference(getProject_ModelElements(), ecorePackage.getEObject(), null, "modelElements", null, 0, -1, //$NON-NLS-1$ |
| Project.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, |
| IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
| initEReference(getProject_CutElements(), ecorePackage.getEObject(), null, "cutElements", null, 0, -1, //$NON-NLS-1$ |
| Project.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, |
| IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(uniqueIdentifierEClass, UniqueIdentifier.class, "UniqueIdentifier", IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ |
| IS_GENERATED_INSTANCE_CLASS); |
| initEAttribute(getUniqueIdentifier_Id(), ecorePackage.getEString(), "id", "Default Value Literal\t", 1, 1, //$NON-NLS-1$ //$NON-NLS-2$ |
| UniqueIdentifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, |
| !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(identifiableElementEClass, IdentifiableElement.class, "IdentifiableElement", IS_ABSTRACT, //$NON-NLS-1$ |
| !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEAttribute(getIdentifiableElement_Identifier(), ecorePackage.getEString(), "identifier", null, 1, 1, //$NON-NLS-1$ |
| IdentifiableElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, |
| !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(modelElementIdEClass, ModelElementId.class, "ModelElementId", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ |
| IS_GENERATED_INSTANCE_CLASS); |
| |
| initEClass(modelVersionEClass, ModelVersion.class, "ModelVersion", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ |
| IS_GENERATED_INSTANCE_CLASS); |
| initEAttribute(getModelVersion_ReleaseNumber(), ecorePackage.getEInt(), "releaseNumber", null, 0, 1, //$NON-NLS-1$ |
| ModelVersion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, |
| !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(nonDomainElementEClass, NonDomainElement.class, "NonDomainElement", IS_ABSTRACT, IS_INTERFACE, //$NON-NLS-1$ |
| IS_GENERATED_INSTANCE_CLASS); |
| |
| initEClass(associationClassElementEClass, AssociationClassElement.class, "AssociationClassElement", IS_ABSTRACT, //$NON-NLS-1$ |
| IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| |
| initEClass(emfStorePropertyEClass, EMFStoreProperty.class, "EMFStoreProperty", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ |
| IS_GENERATED_INSTANCE_CLASS); |
| initEAttribute(getEMFStoreProperty_Key(), ecorePackage.getEString(), "key", null, 0, 1, EMFStoreProperty.class, //$NON-NLS-1$ |
| !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getEMFStoreProperty_Value(), ecorePackage.getEObject(), null, "value", null, 0, 1, //$NON-NLS-1$ |
| EMFStoreProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, |
| !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEAttribute(getEMFStoreProperty_Type(), this.getEMFStorePropertyType(), "type", null, 0, 1, //$NON-NLS-1$ |
| EMFStoreProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, |
| !IS_DERIVED, IS_ORDERED); |
| initEAttribute(getEMFStoreProperty_Version(), ecorePackage.getEInt(), "version", null, 0, 1, //$NON-NLS-1$ |
| EMFStoreProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, |
| !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(propertyMapEntryEClass, Map.Entry.class, "PropertyMapEntry", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ |
| !IS_GENERATED_INSTANCE_CLASS); |
| initEAttribute(getPropertyMapEntry_Key(), ecorePackage.getEString(), "key", null, 0, 1, Map.Entry.class, //$NON-NLS-1$ |
| !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getPropertyMapEntry_Value(), this.getEMFStoreProperty(), null, "value", null, 0, 1, //$NON-NLS-1$ |
| Map.Entry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, |
| !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(propertyStringValueEClass, PropertyStringValue.class, "PropertyStringValue", !IS_ABSTRACT, //$NON-NLS-1$ |
| !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEAttribute(getPropertyStringValue_Value(), ecorePackage.getEString(), "value", null, 0, 1, //$NON-NLS-1$ |
| PropertyStringValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, |
| !IS_DERIVED, IS_ORDERED); |
| |
| // Initialize enums and add enum literals |
| initEEnum(emfStorePropertyTypeEEnum, EMFStorePropertyType.class, "EMFStorePropertyType"); //$NON-NLS-1$ |
| addEEnumLiteral(emfStorePropertyTypeEEnum, EMFStorePropertyType.SHARED); |
| addEEnumLiteral(emfStorePropertyTypeEEnum, EMFStorePropertyType.LOCAL); |
| |
| // Create resource |
| createResource(eNS_URI); |
| } |
| |
| } // ModelPackageImpl |