コード例 #1
0
  /** Creates the shop itself */
  public void createShop() {
    myShop = ShopFactory.eINSTANCE.createShop();

    myCountry1 = ShopFactory.eINSTANCE.createCountry();
    myCountry1.setName("n1");
    myCountry1.setAbbreviation("1");
    myShop.getCountries().add(myCountry1);

    myCountry2 = ShopFactory.eINSTANCE.createCountry();
    myCountry2.setName("n2");
    myCountry2.setAbbreviation("2");
    myShop.getCountries().add(myCountry2);

    myCountry3 = ShopFactory.eINSTANCE.createCountry();
    myCountry3.setName("n3");
    myCountry3.setAbbreviation("3");
    myShop.getCountries().add(myCountry3);

    myCountry4 = ShopFactory.eINSTANCE.createCountry();
    myCountry4.setName("n4");
    myCountry4.setAbbreviation("4");
    myShop.getCountries().add(myCountry4);

    myContact1 = ShopFactory.eINSTANCE.createContact();
    myContact1.setName("a");
    myContact1.setCountry(myCountry1);
    myShop.getContacts().add(myContact1);

    myContact2 = ShopFactory.eINSTANCE.createContact();
    myContact2.setName("b");
    myContact2.setCountry(myCountry2);
    myShop.getContacts().add(myContact2);
  }
コード例 #2
0
  /** Creates the shop itself */
  public void createShop() {
    myShop = ShopFactory.eINSTANCE.createShop();

    Country c;

    c = ShopFactory.eINSTANCE.createCountry();
    c.setName("A");
    c.setAbbreviation("AA");
    myShop.getCountries().add(c);

    c = ShopFactory.eINSTANCE.createCountry();
    c.setName("2A");
    c.setAbbreviation("BarBar");
    myShop.getCountries().add(c);

    c = ShopFactory.eINSTANCE.createCountry();
    c.setName("C");
    c.setAbbreviation("CC");
    myShop.getCountries().add(c);
  }