コード例 #1
0
  /**
   * 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
    IdentitiesPackageImpl theIdentitiesPackage =
        (IdentitiesPackageImpl)
            EPackage.Registry.INSTANCE.getEPackage(IdentitiesPackageImpl.eNS_URI);
    ServicesPackageImpl theServicesPackage =
        (ServicesPackageImpl) EPackage.Registry.INSTANCE.getEPackage(ServicesPackageImpl.eNS_URI);
    FacilitiesPackageImpl theFacilitiesPackage =
        (FacilitiesPackageImpl)
            EPackage.Registry.INSTANCE.getEPackage(FacilitiesPackageImpl.eNS_URI);
    PaymentPackageImpl thePaymentPackage =
        (PaymentPackageImpl) EPackage.Registry.INSTANCE.getEPackage(PaymentPackageImpl.eNS_URI);
    OrderingPackageImpl theOrderingPackage =
        (OrderingPackageImpl) EPackage.Registry.INSTANCE.getEPackage(OrderingPackageImpl.eNS_URI);

    // Create type parameters

    // Set bounds for type parameters

    // Add supertypes to classes
    guestEClass.getESuperTypes().add(theIdentitiesPackage.getRealPerson());
    guestEClass.getESuperTypes().add(this.getClient());
    guestEClass.getESuperTypes().add(theServicesPackage.getServiceConsumer());
    customerEClass.getESuperTypes().add(this.getClient());

    // Initialize classes and features; add operations and parameters
    initEClass(
        guestEClass,
        Guest.class,
        "Guest",
        !IS_ABSTRACT,
        !IS_INTERFACE,
        IS_GENERATED_INSTANCE_CLASS);
    initEReference(
        getGuest_Key(),
        theFacilitiesPackage.getKey(),
        null,
        "key",
        null,
        1,
        1,
        Guest.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_COMPOSITE,
        IS_RESOLVE_PROXIES,
        !IS_UNSETTABLE,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);

    initEClass(
        customerEClass,
        Customer.class,
        "Customer",
        !IS_ABSTRACT,
        !IS_INTERFACE,
        IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(
        getCustomer_PaymentMethod(),
        thePaymentPackage.getPaymentMethod(),
        "paymentMethod",
        null,
        1,
        1,
        Customer.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_UNSETTABLE,
        !IS_ID,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);
    initEReference(
        getCustomer_Card(),
        thePaymentPackage.getCreditCard(),
        null,
        "card",
        null,
        1,
        1,
        Customer.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_COMPOSITE,
        IS_RESOLVE_PROXIES,
        !IS_UNSETTABLE,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);
    initEReference(
        getCustomer_AssociatedAdress(),
        this.getAddress(),
        null,
        "associatedAdress",
        null,
        1,
        1,
        Customer.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_COMPOSITE,
        IS_RESOLVE_PROXIES,
        !IS_UNSETTABLE,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);
    initEReference(
        getCustomer_Identity(),
        theIdentitiesPackage.getIdentity(),
        null,
        "identity",
        null,
        1,
        1,
        Customer.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_COMPOSITE,
        IS_RESOLVE_PROXIES,
        !IS_UNSETTABLE,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);
    initEAttribute(
        getCustomer_Email(),
        ecorePackage.getEString(),
        "email",
        null,
        1,
        1,
        Customer.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_UNSETTABLE,
        !IS_ID,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);

    initEClass(
        addressEClass,
        Address.class,
        "Address",
        !IS_ABSTRACT,
        !IS_INTERFACE,
        IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(
        getAddress_Street(),
        ecorePackage.getEString(),
        "street",
        null,
        1,
        1,
        Address.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_UNSETTABLE,
        !IS_ID,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);
    initEAttribute(
        getAddress_ZipCode(),
        ecorePackage.getEInt(),
        "zipCode",
        null,
        1,
        1,
        Address.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_UNSETTABLE,
        !IS_ID,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);
    initEAttribute(
        getAddress_ZipArea(),
        ecorePackage.getEString(),
        "zipArea",
        null,
        1,
        1,
        Address.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_UNSETTABLE,
        !IS_ID,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);
    initEAttribute(
        getAddress_Country(),
        ecorePackage.getEString(),
        "country",
        null,
        1,
        1,
        Address.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_UNSETTABLE,
        !IS_ID,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);
    initEAttribute(
        getAddress_Region(),
        ecorePackage.getEString(),
        "region",
        null,
        1,
        1,
        Address.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_UNSETTABLE,
        !IS_ID,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);
    initEAttribute(
        getAddress_Municipality(),
        ecorePackage.getEString(),
        "municipality",
        null,
        1,
        1,
        Address.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_UNSETTABLE,
        !IS_ID,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);
    initEAttribute(
        getAddress_CareOf(),
        ecorePackage.getEString(),
        "careOf",
        null,
        1,
        1,
        Address.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_UNSETTABLE,
        !IS_ID,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);

    initEClass(
        iClientEClass,
        IClient.class,
        "IClient",
        IS_ABSTRACT,
        IS_INTERFACE,
        IS_GENERATED_INSTANCE_CLASS);

    EOperation op =
        addEOperation(
            iClientEClass, this.getCustomer(), "createCustomer", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, theIdentitiesPackage.getIdentity(), "identity", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(
        op, thePaymentPackage.getPaymentMethod(), "paymentMethod", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, ecorePackage.getEString(), "email", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, thePaymentPackage.getCreditCard(), "card", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, this.getAddress(), "address", 1, 1, IS_UNIQUE, !IS_ORDERED);

    op = addEOperation(iClientEClass, this.getGuest(), "createGuest", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, ecorePackage.getEString(), "name", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, ecorePackage.getEString(), "ssn", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, ecorePackage.getEInt(), "age", 1, 1, IS_UNIQUE, !IS_ORDERED);

    op =
        addEOperation(
            iClientEClass, this.getAddress(), "createAddress", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, ecorePackage.getEString(), "street", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, ecorePackage.getEInt(), "zipCode", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, ecorePackage.getEString(), "zipArea", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, ecorePackage.getEString(), "country", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, ecorePackage.getEString(), "region", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, ecorePackage.getEString(), "municipality", 1, 1, IS_UNIQUE, !IS_ORDERED);
    addEParameter(op, ecorePackage.getEString(), "careOf", 1, 1, IS_UNIQUE, !IS_ORDERED);

    initEClass(
        clientEClass,
        Client.class,
        "Client",
        IS_ABSTRACT,
        IS_INTERFACE,
        IS_GENERATED_INSTANCE_CLASS);
    initEReference(
        getClient_Invoices(),
        theOrderingPackage.getInvoice(),
        null,
        "invoices",
        null,
        0,
        -1,
        Client.class,
        !IS_TRANSIENT,
        !IS_VOLATILE,
        IS_CHANGEABLE,
        !IS_COMPOSITE,
        IS_RESOLVE_PROXIES,
        !IS_UNSETTABLE,
        IS_UNIQUE,
        !IS_DERIVED,
        !IS_ORDERED);
  }
コード例 #2
0
  /**
   * 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 ClientsPackageImpl#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 ClientsPackageImpl init() {
    if (isInited)
      return (ClientsPackageImpl)
          EPackage.Registry.INSTANCE.getEPackage(ClientsPackageImpl.eNS_URI);

    // Obtain or create and register package
    ClientsPackageImpl theClientsPackage =
        (ClientsPackageImpl)
            (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ClientsPackageImpl
                ? EPackage.Registry.INSTANCE.get(eNS_URI)
                : new ClientsPackageImpl());

    isInited = true;

    // Obtain or create and register interdependencies
    HotelPackageImpl theHotelPackage =
        (HotelPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(HotelPackageImpl.eNS_URI)
                    instanceof HotelPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(HotelPackageImpl.eNS_URI)
                : HotelPackageImpl.eINSTANCE);
    FacilitiesPackageImpl theFacilitiesPackage =
        (FacilitiesPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(FacilitiesPackageImpl.eNS_URI)
                    instanceof FacilitiesPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(FacilitiesPackageImpl.eNS_URI)
                : FacilitiesPackageImpl.eINSTANCE);
    ServicesPackageImpl theServicesPackage =
        (ServicesPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(ServicesPackageImpl.eNS_URI)
                    instanceof ServicesPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(ServicesPackageImpl.eNS_URI)
                : ServicesPackageImpl.eINSTANCE);
    PaymentPackageImpl thePaymentPackage =
        (PaymentPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(PaymentPackageImpl.eNS_URI)
                    instanceof PaymentPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(PaymentPackageImpl.eNS_URI)
                : PaymentPackageImpl.eINSTANCE);
    IdentitiesPackageImpl theIdentitiesPackage =
        (IdentitiesPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(IdentitiesPackageImpl.eNS_URI)
                    instanceof IdentitiesPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(IdentitiesPackageImpl.eNS_URI)
                : IdentitiesPackageImpl.eINSTANCE);
    OrderingPackageImpl theOrderingPackage =
        (OrderingPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(OrderingPackageImpl.eNS_URI)
                    instanceof OrderingPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(OrderingPackageImpl.eNS_URI)
                : OrderingPackageImpl.eINSTANCE);
    PersonnelPackageImpl thePersonnelPackage =
        (PersonnelPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(PersonnelPackageImpl.eNS_URI)
                    instanceof PersonnelPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(PersonnelPackageImpl.eNS_URI)
                : PersonnelPackageImpl.eINSTANCE);
    SchedulePackageImpl theSchedulePackage =
        (SchedulePackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(SchedulePackageImpl.eNS_URI)
                    instanceof SchedulePackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(SchedulePackageImpl.eNS_URI)
                : SchedulePackageImpl.eINSTANCE);
    LogPackageImpl theLogPackage =
        (LogPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(LogPackageImpl.eNS_URI)
                    instanceof LogPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(LogPackageImpl.eNS_URI)
                : LogPackageImpl.eINSTANCE);
    BlacklistPackageImpl theBlacklistPackage =
        (BlacklistPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(BlacklistPackageImpl.eNS_URI)
                    instanceof BlacklistPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(BlacklistPackageImpl.eNS_URI)
                : BlacklistPackageImpl.eINSTANCE);
    InventoryPackageImpl theInventoryPackage =
        (InventoryPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(InventoryPackageImpl.eNS_URI)
                    instanceof InventoryPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(InventoryPackageImpl.eNS_URI)
                : InventoryPackageImpl.eINSTANCE);
    SearchPackageImpl theSearchPackage =
        (SearchPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(SearchPackageImpl.eNS_URI)
                    instanceof SearchPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(SearchPackageImpl.eNS_URI)
                : SearchPackageImpl.eINSTANCE);

    // Create package meta-data objects
    theClientsPackage.createPackageContents();
    theHotelPackage.createPackageContents();
    theFacilitiesPackage.createPackageContents();
    theServicesPackage.createPackageContents();
    thePaymentPackage.createPackageContents();
    theIdentitiesPackage.createPackageContents();
    theOrderingPackage.createPackageContents();
    thePersonnelPackage.createPackageContents();
    theSchedulePackage.createPackageContents();
    theLogPackage.createPackageContents();
    theBlacklistPackage.createPackageContents();
    theInventoryPackage.createPackageContents();
    theSearchPackage.createPackageContents();

    // Initialize created meta-data
    theClientsPackage.initializePackageContents();
    theHotelPackage.initializePackageContents();
    theFacilitiesPackage.initializePackageContents();
    theServicesPackage.initializePackageContents();
    thePaymentPackage.initializePackageContents();
    theIdentitiesPackage.initializePackageContents();
    theOrderingPackage.initializePackageContents();
    thePersonnelPackage.initializePackageContents();
    theSchedulePackage.initializePackageContents();
    theLogPackage.initializePackageContents();
    theBlacklistPackage.initializePackageContents();
    theInventoryPackage.initializePackageContents();
    theSearchPackage.initializePackageContents();

    // Mark meta-data to indicate it can't be changed
    theClientsPackage.freeze();

    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(ClientsPackageImpl.eNS_URI, theClientsPackage);
    return theClientsPackage;
  }