| /** |
| * Copyright (c) 2017 Christian W. Damus 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: |
| * Christian W. Damus - initial API and implementation |
| * |
| */ |
| package org.eclipse.papyrus.compare.uml2.tests.blocks.impl; |
| |
| import org.eclipse.emf.ecore.EAttribute; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EPackage; |
| import org.eclipse.emf.ecore.EReference; |
| import org.eclipse.emf.ecore.EcorePackage; |
| |
| import org.eclipse.emf.ecore.impl.EPackageImpl; |
| |
| import org.eclipse.papyrus.compare.uml2.tests.blocks.Block; |
| import org.eclipse.papyrus.compare.uml2.tests.blocks.BlocksFactory; |
| import org.eclipse.papyrus.compare.uml2.tests.blocks.BlocksPackage; |
| |
| import org.eclipse.papyrus.compare.uml2.tests.elements.ElementsPackage; |
| |
| import org.eclipse.papyrus.compare.uml2.tests.elements.impl.ElementsPackageImpl; |
| |
| import org.eclipse.uml2.types.TypesPackage; |
| |
| import org.eclipse.uml2.uml.UMLPackage; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public class BlocksPackageImpl extends EPackageImpl implements BlocksPackage { |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass blockEClass = 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.papyrus.compare.uml2.tests.blocks.BlocksPackage#eNS_URI |
| * @see #init() |
| * @generated |
| */ |
| private BlocksPackageImpl() { |
| super(eNS_URI, BlocksFactory.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 BlocksPackage#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 BlocksPackage init() { |
| if (isInited) |
| return (BlocksPackage)EPackage.Registry.INSTANCE.getEPackage(BlocksPackage.eNS_URI); |
| |
| // Obtain or create and register package |
| BlocksPackageImpl theBlocksPackage = (BlocksPackageImpl)(EPackage.Registry.INSTANCE |
| .get(eNS_URI) instanceof BlocksPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) |
| : new BlocksPackageImpl()); |
| |
| isInited = true; |
| |
| // Initialize simple dependencies |
| EcorePackage.eINSTANCE.eClass(); |
| TypesPackage.eINSTANCE.eClass(); |
| UMLPackage.eINSTANCE.eClass(); |
| |
| // Obtain or create and register interdependencies |
| ElementsPackageImpl theElementsPackage = (ElementsPackageImpl)(EPackage.Registry.INSTANCE |
| .getEPackage(ElementsPackage.eNS_URI) instanceof ElementsPackageImpl |
| ? EPackage.Registry.INSTANCE.getEPackage(ElementsPackage.eNS_URI) |
| : ElementsPackage.eINSTANCE); |
| |
| // Create package meta-data objects |
| theBlocksPackage.createPackageContents(); |
| theElementsPackage.createPackageContents(); |
| |
| // Initialize created meta-data |
| theBlocksPackage.initializePackageContents(); |
| theElementsPackage.initializePackageContents(); |
| |
| // Mark meta-data to indicate it can't be changed |
| theBlocksPackage.freeze(); |
| |
| // Update the registry and return the package |
| EPackage.Registry.INSTANCE.put(BlocksPackage.eNS_URI, theBlocksPackage); |
| return theBlocksPackage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EClass getBlock() { |
| return blockEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EReference getBlock_Base_Class() { |
| return (EReference)blockEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EAttribute getBlock_IsEncapsulated() { |
| return (EAttribute)blockEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public BlocksFactory getBlocksFactory() { |
| return (BlocksFactory)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 |
| blockEClass = createEClass(BLOCK); |
| createEReference(blockEClass, BLOCK__BASE_CLASS); |
| createEAttribute(blockEClass, BLOCK__IS_ENCAPSULATED); |
| } |
| |
| /** |
| * <!-- 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); |
| TypesPackage theTypesPackage = (TypesPackage)EPackage.Registry.INSTANCE |
| .getEPackage(TypesPackage.eNS_URI); |
| |
| // Create type parameters |
| |
| // Set bounds for type parameters |
| |
| // Add supertypes to classes |
| |
| // Initialize classes, features, and operations; add parameters |
| initEClass(blockEClass, Block.class, "Block", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ |
| IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getBlock_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, //$NON-NLS-1$ |
| Block.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, |
| !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
| initEAttribute(getBlock_IsEncapsulated(), theTypesPackage.getBoolean(), "isEncapsulated", null, 1, 1, //$NON-NLS-1$ |
| Block.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, |
| !IS_DERIVED, !IS_ORDERED); |
| |
| // Create resource |
| createResource(eNS_URI); |
| |
| // Create annotations |
| // http://www.eclipse.org/uml2/2.0.0/UML |
| createUMLAnnotations(); |
| } |
| |
| /** |
| * Initializes the annotations for <b>http://www.eclipse.org/uml2/2.0.0/UML</b>. <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected void createUMLAnnotations() { |
| String source = "http://www.eclipse.org/uml2/2.0.0/UML"; //$NON-NLS-1$ |
| addAnnotation(this, source, new String[] {"originalName", "Blocks" //$NON-NLS-1$ //$NON-NLS-2$ |
| }); |
| } |
| |
| } // BlocksPackageImpl |