/** */ package com.opcoach.project.impl; import com.opcoach.project.MCompany; import com.opcoach.project.MFolder; import com.opcoach.project.MPerson; import com.opcoach.project.MProject; import com.opcoach.project.MProjectFactory; import com.opcoach.project.MProjectPackage; import com.opcoach.project.MTask; import com.opcoach.project.MTaskFolder; import com.opcoach.project.documentation.MDocumentationPackage; import com.opcoach.project.documentation.impl.MDocumentationPackageImpl; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EGenericType; import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.ETypeParameter; import org.eclipse.emf.ecore.impl.EPackageImpl; /** * <!-- begin-user-doc --> * An implementation of the model <b>Package</b>. * <!-- end-user-doc --> * @generated */ public class MProjectPackageImpl extends EPackageImpl implements MProjectPackage { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass personEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass projectEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass taskEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass companyEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass folderEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass taskFolderEClass = 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 com.opcoach.project.MProjectPackage#eNS_URI * @see #init() * @generated */ private MProjectPackageImpl() { super(eNS_URI, MProjectFactory.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 MProjectPackage#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 MProjectPackage init() { if (isInited) return (MProjectPackage)EPackage.Registry.INSTANCE.getEPackage(MProjectPackage.eNS_URI); // Obtain or create and register package MProjectPackageImpl theProjectPackage = (MProjectPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof MProjectPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new MProjectPackageImpl()); isInited = true; // Obtain or create and register interdependencies MDocumentationPackageImpl theDocumentationPackage = (MDocumentationPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(MDocumentationPackage.eNS_URI) instanceof MDocumentationPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(MDocumentationPackage.eNS_URI) : MDocumentationPackage.eINSTANCE); // Create package meta-data objects theProjectPackage.createPackageContents(); theDocumentationPackage.createPackageContents(); // Initialize created meta-data theProjectPackage.initializePackageContents(); theDocumentationPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theProjectPackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(MProjectPackage.eNS_URI, theProjectPackage); return theProjectPackage; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getPerson() { return personEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getPerson_Taille() { return (EAttribute)personEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getPerson_Poids() { return (EAttribute)personEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getPerson_Name() { return (EAttribute)personEClass.getEStructuralFeatures().get(2); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getProject() { return projectEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getProject_Name() { return (EAttribute)projectEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getProject_Tasks() { return (EReference)projectEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getProject_Chief() { return (EReference)projectEClass.getEStructuralFeatures().get(2); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EOperation getProject__FindFirstTask__MPerson() { return projectEClass.getEOperations().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getTask() { return taskEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getTask_Name() { return (EAttribute)taskEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getTask_SubTasks() { return (EReference)taskEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getTask_Responsable() { return (EReference)taskEClass.getEStructuralFeatures().get(2); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getCompany() { return companyEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getCompany_Projects() { return (EReference)companyEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getCompany_Employees() { return (EReference)companyEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getFolder() { return folderEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getFolder_Content() { return (EReference)folderEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EOperation getFolder__GetFirst() { return folderEClass.getEOperations().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getTaskFolder() { return taskFolderEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public MProjectFactory getProjectFactory() { return (MProjectFactory)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 personEClass = createEClass(PERSON); createEAttribute(personEClass, PERSON__TAILLE); createEAttribute(personEClass, PERSON__POIDS); createEAttribute(personEClass, PERSON__NAME); projectEClass = createEClass(PROJECT); createEAttribute(projectEClass, PROJECT__NAME); createEReference(projectEClass, PROJECT__TASKS); createEReference(projectEClass, PROJECT__CHIEF); createEOperation(projectEClass, PROJECT___FIND_FIRST_TASK__MPERSON); taskEClass = createEClass(TASK); createEAttribute(taskEClass, TASK__NAME); createEReference(taskEClass, TASK__SUB_TASKS); createEReference(taskEClass, TASK__RESPONSABLE); companyEClass = createEClass(COMPANY); createEReference(companyEClass, COMPANY__PROJECTS); createEReference(companyEClass, COMPANY__EMPLOYEES); folderEClass = createEClass(FOLDER); createEReference(folderEClass, FOLDER__CONTENT); createEOperation(folderEClass, FOLDER___GET_FIRST); taskFolderEClass = createEClass(TASK_FOLDER); } /** * <!-- 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 MDocumentationPackage theDocumentationPackage = (MDocumentationPackage)EPackage.Registry.INSTANCE.getEPackage(MDocumentationPackage.eNS_URI); // Add subpackages getESubpackages().add(theDocumentationPackage); // Create type parameters ETypeParameter folderEClass_T = addETypeParameter(folderEClass, "T"); // Set bounds for type parameters // Add supertypes to classes EGenericType g1 = createEGenericType(this.getFolder()); EGenericType g2 = createEGenericType(this.getTask()); g1.getETypeArguments().add(g2); taskFolderEClass.getEGenericSuperTypes().add(g1); // Initialize classes, features, and operations; add parameters initEClass(personEClass, MPerson.class, "Person", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getPerson_Taille(), ecorePackage.getEInt(), "taille", null, 0, 1, MPerson.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getPerson_Poids(), ecorePackage.getEInt(), "poids", null, 0, 1, MPerson.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getPerson_Name(), ecorePackage.getEString(), "name", null, 0, 1, MPerson.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(projectEClass, MProject.class, "Project", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getProject_Name(), ecorePackage.getEString(), "name", null, 0, 1, MProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getProject_Tasks(), this.getTask(), null, "tasks", null, 0, -1, MProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getProject_Chief(), this.getPerson(), null, "chief", null, 0, 1, MProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); EOperation op = initEOperation(getProject__FindFirstTask__MPerson(), this.getTask(), "findFirstTask", 0, 1, IS_UNIQUE, IS_ORDERED); addEParameter(op, this.getPerson(), "p", 0, 1, IS_UNIQUE, IS_ORDERED); initEClass(taskEClass, MTask.class, "Task", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getTask_Name(), ecorePackage.getEString(), "name", null, 0, 1, MTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getTask_SubTasks(), this.getTask(), null, "subTasks", null, 0, -1, MTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getTask_Responsable(), this.getPerson(), null, "responsable", null, 0, 1, MTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(companyEClass, MCompany.class, "Company", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getCompany_Projects(), this.getProject(), null, "projects", null, 0, -1, MCompany.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getCompany_Employees(), this.getPerson(), null, "employees", null, 0, -1, MCompany.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(folderEClass, MFolder.class, "Folder", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(folderEClass_T); initEReference(getFolder_Content(), g1, null, "content", null, 0, -1, MFolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); op = initEOperation(getFolder__GetFirst(), null, "getFirst", 0, 1, IS_UNIQUE, IS_ORDERED); g1 = createEGenericType(folderEClass_T); initEOperation(op, g1); initEClass(taskFolderEClass, MTaskFolder.class, "TaskFolder", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); // Create resource createResource(eNS_URI); } } //MProjectPackageImpl