| /** |
| * Copyright (c) 2016 Willink Transformations, Univesity of York 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: |
| * Adolfo Sanchez-Barbudo Herrera - initial API and implementation |
| */ |
| package cs2as.companies.impl; |
| |
| import cs2as.companies.CSTrace; |
| import cs2as.companies.CompaniesFactory; |
| import cs2as.companies.CompaniesPackage; |
| import cs2as.companies.company; |
| import cs2as.companies.department; |
| import cs2as.companies.department_employees; |
| import cs2as.companies.department_manager; |
| import cs2as.companies.employee; |
| |
| import cs2as.company.CompanyPackage; |
| |
| 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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Package</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class CompaniesPackageImpl extends EPackageImpl implements CompaniesPackage { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass companyEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass departmentEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass department_managerEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass department_employeesEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass employeeEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass csTraceEClass = 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 cs2as.companies.CompaniesPackage#eNS_URI |
| * @see #init() |
| * @generated |
| */ |
| private CompaniesPackageImpl() { |
| super(eNS_URI, CompaniesFactory.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 CompaniesPackage#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 CompaniesPackage init() { |
| if (isInited) return (CompaniesPackage)EPackage.Registry.INSTANCE.getEPackage(CompaniesPackage.eNS_URI); |
| |
| // Obtain or create and register package |
| Object ePackage = EPackage.Registry.INSTANCE.get(eNS_URI); |
| CompaniesPackageImpl theCompaniesPackage = (CompaniesPackageImpl)(ePackage instanceof CompaniesPackageImpl ? ePackage : new CompaniesPackageImpl()); |
| |
| isInited = true; |
| |
| // Initialize simple dependencies |
| CompanyPackage.eINSTANCE.eClass(); |
| |
| // Create package meta-data objects |
| theCompaniesPackage.createPackageContents(); |
| |
| // Initialize created meta-data |
| theCompaniesPackage.initializePackageContents(); |
| |
| // Mark meta-data to indicate it can't be changed |
| theCompaniesPackage.freeze(); |
| |
| |
| // Update the registry and return the package |
| EPackage.Registry.INSTANCE.put(CompaniesPackage.eNS_URI, theCompaniesPackage); |
| return theCompaniesPackage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getcompany() { |
| return companyEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getcompany_Name() { |
| return (EAttribute)companyEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getcompany_Deparment() { |
| return (EReference)companyEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getdepartment() { |
| return departmentEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getdepartment_Name() { |
| return (EAttribute)departmentEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getdepartment_Department_manager() { |
| return (EReference)departmentEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getdepartment_Department_employees() { |
| return (EReference)departmentEClass.getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getdepartment_Deparment() { |
| return (EReference)departmentEClass.getEStructuralFeatures().get(3); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getdepartment_manager() { |
| return department_managerEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getdepartment_manager_Employee() { |
| return (EReference)department_managerEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getdepartment_employees() { |
| return department_employeesEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getdepartment_employees_Employee() { |
| return (EReference)department_employeesEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getemployee() { |
| return employeeEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getemployee_Name() { |
| return (EAttribute)employeeEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getemployee_Address() { |
| return (EAttribute)employeeEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getemployee_Salary() { |
| return (EAttribute)employeeEClass.getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getemployee_Mentor() { |
| return (EAttribute)employeeEClass.getEStructuralFeatures().get(3); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getCSTrace() { |
| return csTraceEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getCSTrace_Ast() { |
| return (EReference)csTraceEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CompaniesFactory getCompaniesFactory() { |
| return (CompaniesFactory)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 |
| companyEClass = createEClass(COMPANY); |
| createEAttribute(companyEClass, COMPANY__NAME); |
| createEReference(companyEClass, COMPANY__DEPARMENT); |
| |
| departmentEClass = createEClass(DEPARTMENT); |
| createEAttribute(departmentEClass, DEPARTMENT__NAME); |
| createEReference(departmentEClass, DEPARTMENT__DEPARTMENT_MANAGER); |
| createEReference(departmentEClass, DEPARTMENT__DEPARTMENT_EMPLOYEES); |
| createEReference(departmentEClass, DEPARTMENT__DEPARMENT); |
| |
| department_managerEClass = createEClass(DEPARTMENT_MANAGER); |
| createEReference(department_managerEClass, DEPARTMENT_MANAGER__EMPLOYEE); |
| |
| department_employeesEClass = createEClass(DEPARTMENT_EMPLOYEES); |
| createEReference(department_employeesEClass, DEPARTMENT_EMPLOYEES__EMPLOYEE); |
| |
| employeeEClass = createEClass(EMPLOYEE); |
| createEAttribute(employeeEClass, EMPLOYEE__NAME); |
| createEAttribute(employeeEClass, EMPLOYEE__ADDRESS); |
| createEAttribute(employeeEClass, EMPLOYEE__SALARY); |
| createEAttribute(employeeEClass, EMPLOYEE__MENTOR); |
| |
| csTraceEClass = createEClass(CS_TRACE); |
| createEReference(csTraceEClass, CS_TRACE__AST); |
| } |
| |
| /** |
| * <!-- 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 |
| CompanyPackage theCompanyPackage = (CompanyPackage)EPackage.Registry.INSTANCE.getEPackage(CompanyPackage.eNS_URI); |
| |
| // Create type parameters |
| |
| // Set bounds for type parameters |
| |
| // Add supertypes to classes |
| companyEClass.getESuperTypes().add(this.getCSTrace()); |
| departmentEClass.getESuperTypes().add(this.getCSTrace()); |
| department_managerEClass.getESuperTypes().add(this.getCSTrace()); |
| department_employeesEClass.getESuperTypes().add(this.getCSTrace()); |
| employeeEClass.getESuperTypes().add(this.getCSTrace()); |
| |
| // Initialize classes and features; add operations and parameters |
| initEClass(companyEClass, company.class, "company", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEAttribute(getcompany_Name(), ecorePackage.getEString(), "name", null, 0, 1, company.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getcompany_Deparment(), this.getdepartment(), null, "deparment", null, 0, -1, company.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(departmentEClass, department.class, "department", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEAttribute(getdepartment_Name(), ecorePackage.getEString(), "name", null, 0, 1, department.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getdepartment_Department_manager(), this.getdepartment_manager(), null, "department_manager", null, 0, 1, department.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getdepartment_Department_employees(), this.getdepartment_employees(), null, "department_employees", null, 0, 1, department.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getdepartment_Deparment(), this.getdepartment(), null, "deparment", null, 0, -1, department.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(department_managerEClass, department_manager.class, "department_manager", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getdepartment_manager_Employee(), this.getemployee(), null, "employee", null, 0, 1, department_manager.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(department_employeesEClass, department_employees.class, "department_employees", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getdepartment_employees_Employee(), this.getemployee(), null, "employee", null, 0, -1, department_employees.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(employeeEClass, employee.class, "employee", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEAttribute(getemployee_Name(), ecorePackage.getEString(), "name", null, 0, 1, employee.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEAttribute(getemployee_Address(), ecorePackage.getEString(), "address", null, 0, 1, employee.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEAttribute(getemployee_Salary(), ecorePackage.getEDouble(), "salary", null, 0, 1, employee.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEAttribute(getemployee_Mentor(), ecorePackage.getEString(), "mentor", null, 0, 1, employee.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(csTraceEClass, CSTrace.class, "CSTrace", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getCSTrace_Ast(), theCompanyPackage.getVisitable(), null, "ast", null, 0, 1, CSTrace.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| // Create resource |
| createResource(eNS_URI); |
| } |
| |
| } //CompaniesPackageImpl |