| /******************************************************************************* |
| * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Eugen Neufeld - initial API and implementation |
| ******************************************************************************/ |
| package org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.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.impl.EPackageImpl; |
| import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.ChildLevel1; |
| import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.ChildLevel2; |
| import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.Root; |
| import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.TestTMDFactory; |
| import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.TestTMDPackage; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- |
| * end-user-doc --> |
| * |
| * @generated |
| */ |
| public class TestTMDPackageImpl extends EPackageImpl implements TestTMDPackage { |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass rootEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass childLevel1EClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| private EClass childLevel2EClass = 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.ecp.view.treemasterdetail.validation.test.TestTMD.TestTMDPackage#eNS_URI |
| * @see #init() |
| * @generated |
| */ |
| private TestTMDPackageImpl() { |
| super(eNS_URI, TestTMDFactory.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 TestTMDPackage#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 TestTMDPackage init() { |
| if (isInited) { |
| return (TestTMDPackage) EPackage.Registry.INSTANCE |
| .getEPackage(TestTMDPackage.eNS_URI); |
| } |
| |
| // Obtain or create and register package |
| final TestTMDPackageImpl theTestTMDPackage = (TestTMDPackageImpl) (EPackage.Registry.INSTANCE |
| .get(eNS_URI) instanceof TestTMDPackageImpl ? EPackage.Registry.INSTANCE |
| .get(eNS_URI) : new TestTMDPackageImpl()); |
| |
| isInited = true; |
| |
| // Create package meta-data objects |
| theTestTMDPackage.createPackageContents(); |
| |
| // Initialize created meta-data |
| theTestTMDPackage.initializePackageContents(); |
| |
| // Mark meta-data to indicate it can't be changed |
| theTestTMDPackage.freeze(); |
| |
| // Update the registry and return the package |
| EPackage.Registry.INSTANCE.put(TestTMDPackage.eNS_URI, |
| theTestTMDPackage); |
| return theTestTMDPackage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EClass getRoot() { |
| return rootEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EAttribute getRoot_Name() { |
| return (EAttribute) rootEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EReference getRoot_Children() { |
| return (EReference) rootEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EClass getChildLevel1() { |
| return childLevel1EClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EAttribute getChildLevel1_Name() { |
| return (EAttribute) childLevel1EClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EReference getChildLevel1_Children() { |
| return (EReference) childLevel1EClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EClass getChildLevel2() { |
| return childLevel2EClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EAttribute getChildLevel2_Name() { |
| return (EAttribute) childLevel2EClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public TestTMDFactory getTestTMDFactory() { |
| return (TestTMDFactory) 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 |
| rootEClass = createEClass(ROOT); |
| createEAttribute(rootEClass, ROOT__NAME); |
| createEReference(rootEClass, ROOT__CHILDREN); |
| |
| childLevel1EClass = createEClass(CHILD_LEVEL1); |
| createEAttribute(childLevel1EClass, CHILD_LEVEL1__NAME); |
| createEReference(childLevel1EClass, CHILD_LEVEL1__CHILDREN); |
| |
| childLevel2EClass = createEClass(CHILD_LEVEL2); |
| createEAttribute(childLevel2EClass, CHILD_LEVEL2__NAME); |
| } |
| |
| /** |
| * <!-- 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( |
| rootEClass, |
| Root.class, "Root", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ |
| initEAttribute( |
| getRoot_Name(), |
| ecorePackage.getEString(), |
| "name", null, 1, 1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, //$NON-NLS-1$ |
| IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference( |
| getRoot_Children(), |
| getChildLevel1(), |
| null, |
| "children", null, 0, -1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, //$NON-NLS-1$ |
| !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass( |
| childLevel1EClass, |
| ChildLevel1.class, "ChildLevel1", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ |
| initEAttribute( |
| getChildLevel1_Name(), |
| ecorePackage.getEString(), |
| "name", null, 1, 1, ChildLevel1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, //$NON-NLS-1$ |
| IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference( |
| getChildLevel1_Children(), |
| getChildLevel2(), |
| null, |
| "children", null, 0, -1, ChildLevel1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, //$NON-NLS-1$ |
| !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass( |
| childLevel2EClass, |
| ChildLevel2.class, "ChildLevel2", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ |
| initEAttribute( |
| getChildLevel2_Name(), |
| ecorePackage.getEString(), |
| "name", null, 1, 1, ChildLevel2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, //$NON-NLS-1$ |
| IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| // Create resource |
| createResource(eNS_URI); |
| } |
| |
| } // TestTMDPackageImpl |