Package org.eclipse.emf.ecore

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


            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")) {
              logger.debug("{} found boolean value", LoggerConstants.CONFIG);
              tfConfig.eSet(feature, Boolean.parseBoolean(deviceConfig.get(property)));
View Full Code Here


            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")) {
              logger.debug("{} found boolean value", LoggerConstants.CONFIG);
              tfConfig.eSet(feature, Boolean.parseBoolean(deviceConfig.get(property)));
            } else if (className.equals("java.lang.String")) {
              logger.debug("{} found String value", LoggerConstants.CONFIG);
View Full Code Here

              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")) {
              logger.debug("{} found boolean value", LoggerConstants.CONFIG);
              tfConfig.eSet(feature, Boolean.parseBoolean(deviceConfig.get(property)));
            } else if (className.equals("java.lang.String")) {
              logger.debug("{} found String value", LoggerConstants.CONFIG);
              tfConfig.eSet(feature, deviceConfig.get(property));
            } else if (className.equals("java.math.BigDecimal")) {
              logger.debug("{} found BigDecimal value", LoggerConstants.CONFIG);
View Full Code Here

            } else if (className.equals("boolean") || className.equals("java.lang.Boolean")) {
              logger.debug("{} found boolean value", LoggerConstants.CONFIG);
              tfConfig.eSet(feature, Boolean.parseBoolean(deviceConfig.get(property)));
            } else if (className.equals("java.lang.String")) {
              logger.debug("{} found String value", LoggerConstants.CONFIG);
              tfConfig.eSet(feature, deviceConfig.get(property));
            } else if (className.equals("java.math.BigDecimal")) {
              logger.debug("{} found BigDecimal value", LoggerConstants.CONFIG);
              tfConfig.eSet(feature, new BigDecimal(deviceConfig.get(property)));
              // } else if (feature.getEType().getInstanceClassName().equals("EList")){
              // logger.debug("{} found EList value", LoggerConstants.CONFIG);
View Full Code Here

            } else if (className.equals("java.lang.String")) {
              logger.debug("{} found String value", LoggerConstants.CONFIG);
              tfConfig.eSet(feature, deviceConfig.get(property));
            } else if (className.equals("java.math.BigDecimal")) {
              logger.debug("{} found BigDecimal value", LoggerConstants.CONFIG);
              tfConfig.eSet(feature, new BigDecimal(deviceConfig.get(property)));
              // } else if (feature.getEType().getInstanceClassName().equals("EList")){
              // logger.debug("{} found EList value", LoggerConstants.CONFIG);
              // List<String> strings = new
              // ArrayList<String>(Arrays.asList(deviceConfig.get(property).trim().split("\\s+")));
              // tfConfig.eSet(feature, strings);
View Full Code Here

          if (nextToken == JsonToken.START_ARRAY) {
            EList values = new BasicEList();
            while (jp.nextToken() != JsonToken.END_ARRAY) {
              values.add(parseValueForDataType(jp, dataType));
            }
            result.eSet(feature, values);
          }
        }
        else {
          result.eSet(feature, parseValueForDataType(jp, dataType));
        }
View Full Code Here

            }
            result.eSet(feature, values);
          }
        }
        else {
          result.eSet(feature, parseValueForDataType(jp, dataType));
        }
      }
      else if (feature instanceof EReference) {
        EReference eRef = (EReference) feature;
        if (!eRef.isContainment()) {
View Full Code Here

        if (feature.isMany() && nextToken == JsonToken.START_ARRAY) {
          EList values = new BasicEList();
          while (jp.nextToken() != JsonToken.END_ARRAY) {
            values.add(from(jp, eRef.getEReferenceType()));
          }
          result.eSet(feature, values);
        }
        else {
          result.eSet(feature, from(jp, eRef.getEReferenceType()));
        }
      }
View Full Code Here

            values.add(from(jp, eRef.getEReferenceType()));
          }
          result.eSet(feature, values);
        }
        else {
          result.eSet(feature, from(jp, eRef.getEReferenceType()));
        }
      }
      else if (result instanceof JsObject) {
        JsObject jsObj = (JsObject) result;
        jsObj.getUnmatched().put(fieldName, parseValueForUnmapped(nextToken, jp));
View Full Code Here

          for( Entry<String, String> e : valueMap(s).entrySet() ) {
            String name = e.getKey().replaceAll("-", "_");
            EStructuralFeature styleFeature = o.eClass().getEStructuralFeature(name.trim());
            if( styleFeature != null ) {
              Object value = EcoreUtil.createFromString((EDataType) styleFeature.getEType(), e.getValue());
              o.eSet(styleFeature, value);
            } else {
              System.err.println("Could not find style attribute: " + name + " on " + o.eClass());
            }
          }
        }
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.