| /* |
| * Copyright (c) 2011 CEA and others. |
| * 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: |
| * CEA - initial API and implementation |
| * |
| */ |
| package org.eclipse.uml2.uml.profile.l3.internal.impl; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EPackage; |
| import org.eclipse.emf.ecore.EReference; |
| |
| import org.eclipse.emf.ecore.impl.EPackageImpl; |
| |
| import org.eclipse.uml2.uml.UMLPackage; |
| |
| import org.eclipse.uml2.uml.profile.l3.BuildComponent; |
| import org.eclipse.uml2.uml.profile.l3.L3Factory; |
| import org.eclipse.uml2.uml.profile.l3.L3Package; |
| import org.eclipse.uml2.uml.profile.l3.Metamodel; |
| import org.eclipse.uml2.uml.profile.l3.SystemModel; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Package</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class L3PackageImpl |
| extends EPackageImpl |
| implements L3Package { |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass buildComponentEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass metamodelEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass systemModelEClass = 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.uml2.uml.profile.l3.L3Package#eNS_URI |
| * @see #init() |
| * @generated |
| */ |
| private L3PackageImpl() { |
| super(eNS_URI, L3Factory.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 L3Package#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 L3Package init() { |
| if (isInited) |
| return (L3Package) EPackage.Registry.INSTANCE |
| .getEPackage(L3Package.eNS_URI); |
| |
| // Obtain or create and register package |
| L3PackageImpl theL3Package = (L3PackageImpl) (EPackage.Registry.INSTANCE |
| .get(eNS_URI) instanceof L3PackageImpl |
| ? EPackage.Registry.INSTANCE.get(eNS_URI) |
| : new L3PackageImpl()); |
| |
| isInited = true; |
| |
| // Initialize simple dependencies |
| UMLPackage.eINSTANCE.eClass(); |
| |
| // Create package meta-data objects |
| theL3Package.createPackageContents(); |
| |
| // Initialize created meta-data |
| theL3Package.initializePackageContents(); |
| |
| // Mark meta-data to indicate it can't be changed |
| theL3Package.freeze(); |
| |
| // Update the registry and return the package |
| EPackage.Registry.INSTANCE.put(L3Package.eNS_URI, theL3Package); |
| return theL3Package; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getBuildComponent() { |
| return buildComponentEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getBuildComponent_Base_Component() { |
| return (EReference) buildComponentEClass.getEStructuralFeatures() |
| .get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getMetamodel() { |
| return metamodelEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getMetamodel_Base_Model() { |
| return (EReference) metamodelEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getSystemModel() { |
| return systemModelEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getSystemModel_Base_Model() { |
| return (EReference) systemModelEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public L3Factory getL3Factory() { |
| return (L3Factory) 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 |
| buildComponentEClass = createEClass(BUILD_COMPONENT); |
| createEReference(buildComponentEClass, BUILD_COMPONENT__BASE_COMPONENT); |
| |
| metamodelEClass = createEClass(METAMODEL); |
| createEReference(metamodelEClass, METAMODEL__BASE_MODEL); |
| |
| systemModelEClass = createEClass(SYSTEM_MODEL); |
| createEReference(systemModelEClass, SYSTEM_MODEL__BASE_MODEL); |
| } |
| |
| /** |
| * <!-- 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); |
| |
| // Obtain other dependent packages |
| UMLPackage theUMLPackage = (UMLPackage) EPackage.Registry.INSTANCE |
| .getEPackage(UMLPackage.eNS_URI); |
| |
| // Create type parameters |
| |
| // Set bounds for type parameters |
| |
| // Add supertypes to classes |
| |
| // Initialize classes, features, and operations; add parameters |
| initEClass( |
| buildComponentEClass, |
| BuildComponent.class, |
| "BuildComponent", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ |
| initEReference( |
| getBuildComponent_Base_Component(), |
| theUMLPackage.getComponent(), |
| null, |
| "base_Component", null, 1, 1, BuildComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ |
| |
| initEClass( |
| metamodelEClass, |
| Metamodel.class, |
| "Metamodel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ |
| initEReference( |
| getMetamodel_Base_Model(), |
| theUMLPackage.getModel(), |
| null, |
| "base_Model", null, 1, 1, Metamodel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ |
| |
| initEClass( |
| systemModelEClass, |
| SystemModel.class, |
| "SystemModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ |
| initEReference( |
| getSystemModel_Base_Model(), |
| theUMLPackage.getModel(), |
| null, |
| "base_Model", null, 1, 1, SystemModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ |
| |
| // Create resource |
| createResource(eNS_URI); |
| } |
| |
| } //L3PackageImpl |