| /******************************************************************************* |
| * Copyright (c) 2015, 2019 Willink Transformations and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * E.D.Willink - initial API and implementation |
| *******************************************************************************/ |
| /** |
| */ |
| package example1.target.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.ocl.pivot.oclstdlib.OCLstdlibPackage; |
| import example1.target.NamedElement; |
| import example1.target.Namespace; |
| import example1.target.TRoot; |
| import example1.target.TargetFactory; |
| import example1.target.TargetPackage; |
| import example1.target.lookup.EnvironmentPackage; |
| import example1.target.lookup.impl.EnvironmentPackageImpl; |
| import example1.target.util.Visitable; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Package</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class TargetPackageImpl extends EPackageImpl implements TargetPackage { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass aEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass a1EClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass a2EClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass a3EClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass bEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass cEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass dEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass tRootEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass namedElementEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass namespaceEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass visitableEClass = 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 example1.target.TargetPackage#eNS_URI |
| * @see #init() |
| * @generated |
| */ |
| private TargetPackageImpl() { |
| super(eNS_URI, TargetFactory.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 TargetPackage#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 TargetPackage init() { |
| if (isInited) return (TargetPackage)EPackage.Registry.INSTANCE.getEPackage(TargetPackage.eNS_URI); |
| |
| // Obtain or create and register package |
| Object registeredTargetPackage = EPackage.Registry.INSTANCE.get(eNS_URI); |
| TargetPackageImpl theTargetPackage = registeredTargetPackage instanceof TargetPackageImpl ? (TargetPackageImpl)registeredTargetPackage : new TargetPackageImpl(); |
| |
| isInited = true; |
| |
| // Initialize simple dependencies |
| OCLstdlibPackage.eINSTANCE.eClass(); |
| |
| // Obtain or create and register interdependencies |
| Object registeredPackage = EPackage.Registry.INSTANCE.getEPackage(EnvironmentPackage.eNS_URI); |
| EnvironmentPackageImpl theEnvironmentPackage = (EnvironmentPackageImpl)(registeredPackage instanceof EnvironmentPackageImpl ? registeredPackage : EnvironmentPackage.eINSTANCE); |
| |
| // Create package meta-data objects |
| theTargetPackage.createPackageContents(); |
| theEnvironmentPackage.createPackageContents(); |
| |
| // Initialize created meta-data |
| theTargetPackage.initializePackageContents(); |
| theEnvironmentPackage.initializePackageContents(); |
| |
| // Mark meta-data to indicate it can't be changed |
| theTargetPackage.freeze(); |
| |
| // Update the registry and return the package |
| EPackage.Registry.INSTANCE.put(TargetPackage.eNS_URI, theTargetPackage); |
| return theTargetPackage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getA() { |
| return aEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getA1() { |
| return a1EClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getA1_OwnsB() { |
| return (EReference)a1EClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getA2() { |
| return a2EClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getA2_OwnsC() { |
| return (EReference)a2EClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getA3() { |
| return a3EClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getB() { |
| return bEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getB_ToA1() { |
| return (EReference)bEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getB_OwnsD() { |
| return (EReference)bEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getC() { |
| return cEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getC_ToA2() { |
| return (EReference)cEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getC_OwnsD() { |
| return (EReference)cEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getD() { |
| return dEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getD_ToC() { |
| return (EReference)dEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getD_ToB() { |
| return (EReference)dEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getD_ToA() { |
| return (EReference)dEClass.getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getD_RefsB() { |
| return (EReference)dEClass.getEStructuralFeatures().get(3); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getD_RefsC() { |
| return (EReference)dEClass.getEStructuralFeatures().get(4); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getTRoot() { |
| return tRootEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getTRoot_OwnedA() { |
| return (EReference)tRootEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getNamedElement() { |
| return namedElementEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EAttribute getNamedElement_Name() { |
| return (EAttribute)namedElementEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getNamespace() { |
| return namespaceEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getVisitable() { |
| return visitableEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public TargetFactory getTargetFactory() { |
| return (TargetFactory)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 |
| aEClass = createEClass(A); |
| |
| a1EClass = createEClass(A1); |
| createEReference(a1EClass, A1__OWNS_B); |
| |
| a2EClass = createEClass(A2); |
| createEReference(a2EClass, A2__OWNS_C); |
| |
| a3EClass = createEClass(A3); |
| |
| bEClass = createEClass(B); |
| createEReference(bEClass, B__TO_A1); |
| createEReference(bEClass, B__OWNS_D); |
| |
| cEClass = createEClass(C); |
| createEReference(cEClass, C__TO_A2); |
| createEReference(cEClass, C__OWNS_D); |
| |
| dEClass = createEClass(D); |
| createEReference(dEClass, D__TO_C); |
| createEReference(dEClass, D__TO_B); |
| createEReference(dEClass, D__TO_A); |
| createEReference(dEClass, D__REFS_B); |
| createEReference(dEClass, D__REFS_C); |
| |
| tRootEClass = createEClass(TROOT); |
| createEReference(tRootEClass, TROOT__OWNED_A); |
| |
| namedElementEClass = createEClass(NAMED_ELEMENT); |
| createEAttribute(namedElementEClass, NAMED_ELEMENT__NAME); |
| |
| namespaceEClass = createEClass(NAMESPACE); |
| |
| visitableEClass = createEClass(VISITABLE); |
| } |
| |
| /** |
| * <!-- 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 |
| aEClass.getESuperTypes().add(this.getNamespace()); |
| a1EClass.getESuperTypes().add(this.getA()); |
| a2EClass.getESuperTypes().add(this.getA()); |
| a3EClass.getESuperTypes().add(this.getA2()); |
| bEClass.getESuperTypes().add(this.getNamespace()); |
| cEClass.getESuperTypes().add(this.getNamespace()); |
| dEClass.getESuperTypes().add(this.getNamedElement()); |
| tRootEClass.getESuperTypes().add(this.getVisitable()); |
| namedElementEClass.getESuperTypes().add(this.getVisitable()); |
| namespaceEClass.getESuperTypes().add(this.getNamedElement()); |
| |
| // Initialize classes, features, and operations; add parameters |
| initEClass(aEClass, example1.target.A.class, "A", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| |
| initEClass(a1EClass, example1.target.A1.class, "A1", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getA1_OwnsB(), this.getB(), this.getB_ToA1(), "ownsB", null, 0, -1, example1.target.A1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(a2EClass, example1.target.A2.class, "A2", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getA2_OwnsC(), this.getC(), this.getC_ToA2(), "ownsC", null, 0, -1, example1.target.A2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(a3EClass, example1.target.A3.class, "A3", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| |
| initEClass(bEClass, example1.target.B.class, "B", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getB_ToA1(), this.getA1(), this.getA1_OwnsB(), "toA1", null, 0, 1, example1.target.B.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getB_OwnsD(), this.getD(), this.getD_ToB(), "ownsD", null, 0, 1, example1.target.B.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(cEClass, example1.target.C.class, "C", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getC_ToA2(), this.getA2(), this.getA2_OwnsC(), "toA2", null, 0, 1, example1.target.C.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getC_OwnsD(), this.getD(), this.getD_ToC(), "ownsD", null, 0, 1, example1.target.C.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(dEClass, example1.target.D.class, "D", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getD_ToC(), this.getC(), this.getC_OwnsD(), "toC", null, 0, 1, example1.target.D.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getD_ToB(), this.getB(), this.getB_OwnsD(), "toB", null, 0, 1, example1.target.D.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getD_ToA(), this.getA(), null, "toA", null, 1, 1, example1.target.D.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getD_RefsB(), this.getB(), null, "refsB", null, 0, 1, example1.target.D.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getD_RefsC(), this.getC(), null, "refsC", null, 0, 1, example1.target.D.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(tRootEClass, TRoot.class, "TRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getTRoot_OwnedA(), this.getA(), null, "ownedA", null, 0, -1, TRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(namedElementEClass, NamedElement.class, "NamedElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEAttribute(getNamedElement_Name(), ecorePackage.getEString(), "name", null, 0, 1, NamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(namespaceEClass, Namespace.class, "Namespace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| |
| initEClass(visitableEClass, Visitable.class, "Visitable", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); |
| |
| // Create resource |
| createResource(eNS_URI); |
| |
| // Create annotations |
| // http://www.eclipse.org/emf/2002/Ecore |
| createEcoreAnnotations(); |
| } |
| |
| /** |
| * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void createEcoreAnnotations() { |
| String source = "http://www.eclipse.org/emf/2002/Ecore"; |
| addAnnotation |
| (this, |
| source, |
| new String[] { |
| }); |
| } |
| |
| } //TargetPackageImpl |