Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EObject.eSet()


  public EObject createObject(EFactory eFactory, EClassifier type)
  {
    if (type == propertyClass && propertyClass != null)
    {
      EObject property = propertyClass.getEPackage().getEFactoryInstance().create(propertyClass);
      property.eSet(EcorePackage.Literals.ETYPED_ELEMENT__LOWER_BOUND, ONE);
      property.eSet(EcorePackage.Literals.ETYPED_ELEMENT__ORDERED, Boolean.FALSE);
      propertyFeatureList.add(property);
      return property;
    }
    else if (EcorePackage.Literals.EANNOTATION == type)
View Full Code Here


  {
    if (type == propertyClass && propertyClass != null)
    {
      EObject property = propertyClass.getEPackage().getEFactoryInstance().create(propertyClass);
      property.eSet(EcorePackage.Literals.ETYPED_ELEMENT__LOWER_BOUND, ONE);
      property.eSet(EcorePackage.Literals.ETYPED_ELEMENT__ORDERED, Boolean.FALSE);
      propertyFeatureList.add(property);
      return property;
    }
    else if (EcorePackage.Literals.EANNOTATION == type)
    {
View Full Code Here

            value = list;
          } else {
            value = EcoreUtil.createFromString(type, (String) value);
          }
        }
        permissionInstance.eSet(attr, value);
      }
    }
    return roInstance;
  }
View Full Code Here

    // get factory to create instances
    EFactory instanceFactory = model.getEFactoryInstance();

    // Create PObject instance
    EObject pObjectInstance = instanceFactory.create(pObject);
    pObjectInstance.eSet(pObjectRegionAttr, "EU");

    // Create Permission instance
    EObject permissionInstance = instanceFactory.create(permission);
    permissionInstance.eSet(permRegionAttr, "EU");
View Full Code Here

    EObject pObjectInstance = instanceFactory.create(pObject);
    pObjectInstance.eSet(pObjectRegionAttr, "EU");

    // Create Permission instance
    EObject permissionInstance = instanceFactory.create(permission);
    permissionInstance.eSet(permRegionAttr, "EU");

    // Create Role instance
    EObject roleInstance = instanceFactory.create(role);
    roleInstance.eSet(permissionRef, permissionInstance);
View Full Code Here

    EObject permissionInstance = instanceFactory.create(permission);
    permissionInstance.eSet(permRegionAttr, "EU");

    // Create Role instance
    EObject roleInstance = instanceFactory.create(role);
    roleInstance.eSet(permissionRef, permissionInstance);

    return evaluator.evaluate(pObjectInstance, roleInstance, operation);
  }

  private EAttribute getRegionAttr() {
View Full Code Here

            ChangeRecorder r = new ChangeRecorder(eFeature);
            Object o1 = eFeature.eGet(eAttribute);
            System.out.println("2: " + o1);
            Object o2 = eFeature.eGet(eAttribute);
            System.out.println("2: " + o2);
            eFeature.eSet(eAttribute, v);
            ChangeDescription c = r.endRecording();
            c.applyAndReverse();
            c.apply();
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
View Full Code Here

        String name = descriptor.getName();
        EStructuralFeature feature = poInstance.eClass().getEStructuralFeature(name);
        if (feature != null) {
          try {
            Object value = method.invoke(object, new Object[0]);
            poInstance.eSet(feature, value);
            LogFactory.getLog(JavaInstanceMapper.class).debug(MessageFormat.format("Set attibute {0}", name));
          } catch (Exception e) {
            throw new CreateObjectException(MessageFormat.format("Unable to set the feature {0}: {1}", name, e.getLocalizedMessage()));
          }
        }
View Full Code Here

        } else {
          throw new CreateObjectException(MessageFormat.format("Can''t create instance of {0} protected object: the value of attribute {1} isn''t defined", po.getName(), attrName));
        }
      }
      try {
        poInstance.eSet(attribute, value);
      } catch (ClassCastException e) {
        throw new CreateObjectException(MessageFormat.format("Can''t create instance of {0} protected object: the value of attribute {1} has incorrect type: {2}", po.getName(), attrName, e.getLocalizedMessage()));
      }
    }
    return poInstance;
View Full Code Here

            logger.trace("{} feature type {}", LoggerConstants.CONFIG, feature.getEType()
                .getInstanceClassName());
            logger.debug("configuring feature: {} for uid {}", feature.getName(), uid);
            String className = feature.getEType().getInstanceClassName();
            if (className.equals("int")) {
              tfConfig.eSet(feature, Integer.parseInt(deviceConfig.get(property)));
            } else if (className.equals("short") || className.equals("java.lang.Short")) {
              tfConfig.eSet(feature, Short.parseShort(deviceConfig.get(property)));
            } else if (className.equals("long") || className.equals("java.lang.Long")) {
              tfConfig.eSet(feature, Long.parseLong(deviceConfig.get(property)));
            } else if (className.equals("boolean") || className.equals("java.lang.Boolean")) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.