| /** |
| * 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.elements.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.BlocksPackage; |
| |
| import org.eclipse.papyrus.compare.uml2.tests.blocks.impl.BlocksPackageImpl; |
| |
| import org.eclipse.papyrus.compare.uml2.tests.elements.ElementsFactory; |
| import org.eclipse.papyrus.compare.uml2.tests.elements.ElementsPackage; |
| import org.eclipse.papyrus.compare.uml2.tests.elements.Viewpoint; |
| |
| 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 ElementsPackageImpl extends EPackageImpl implements ElementsPackage { |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass viewpointEClass = 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.elements.ElementsPackage#eNS_URI |
| * @see #init() |
| * @generated |
| */ |
| private ElementsPackageImpl() { |
| super(eNS_URI, ElementsFactory.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 ElementsPackage#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 ElementsPackage init() { |
| if (isInited) |
| return (ElementsPackage)EPackage.Registry.INSTANCE.getEPackage(ElementsPackage.eNS_URI); |
| |
| // Obtain or create and register package |
| ElementsPackageImpl theElementsPackage = (ElementsPackageImpl)(EPackage.Registry.INSTANCE |
| .get(eNS_URI) instanceof ElementsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) |
| : new ElementsPackageImpl()); |
| |
| isInited = true; |
| |
| // Initialize simple dependencies |
| EcorePackage.eINSTANCE.eClass(); |
| TypesPackage.eINSTANCE.eClass(); |
| UMLPackage.eINSTANCE.eClass(); |
| |
| // Obtain or create and register interdependencies |
| BlocksPackageImpl theBlocksPackage = (BlocksPackageImpl)(EPackage.Registry.INSTANCE |
| .getEPackage(BlocksPackage.eNS_URI) instanceof BlocksPackageImpl |
| ? EPackage.Registry.INSTANCE.getEPackage(BlocksPackage.eNS_URI) |
| : BlocksPackage.eINSTANCE); |
| |
| // Create package meta-data objects |
| theElementsPackage.createPackageContents(); |
| theBlocksPackage.createPackageContents(); |
| |
| // Initialize created meta-data |
| theElementsPackage.initializePackageContents(); |
| theBlocksPackage.initializePackageContents(); |
| |
| // Mark meta-data to indicate it can't be changed |
| theElementsPackage.freeze(); |
| |
| // Update the registry and return the package |
| EPackage.Registry.INSTANCE.put(ElementsPackage.eNS_URI, theElementsPackage); |
| return theElementsPackage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EClass getViewpoint() { |
| return viewpointEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EReference getViewpoint_Base_Class() { |
| return (EReference)viewpointEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EAttribute getViewpoint_Purpose() { |
| return (EAttribute)viewpointEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public ElementsFactory getElementsFactory() { |
| return (ElementsFactory)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 |
| viewpointEClass = createEClass(VIEWPOINT); |
| createEReference(viewpointEClass, VIEWPOINT__BASE_CLASS); |
| createEAttribute(viewpointEClass, VIEWPOINT__PURPOSE); |
| } |
| |
| /** |
| * <!-- 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(viewpointEClass, Viewpoint.class, "Viewpoint", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ |
| IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getViewpoint_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, //$NON-NLS-1$ |
| Viewpoint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, |
| IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
| initEAttribute(getViewpoint_Purpose(), theTypesPackage.getString(), "purpose", null, 1, 1, //$NON-NLS-1$ |
| Viewpoint.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", "ModelElements" //$NON-NLS-1$ //$NON-NLS-2$ |
| }); |
| } |
| |
| } // ElementsPackageImpl |