Package org.codehaus.jackson

Examples of org.codehaus.jackson.JsonNode.asText()


        {
            String fieldName = fieldNames.next();
            JsonNode fieldNode = parent.get(fieldName);
            if (fieldName.equals(ID))
            {
                idAsString = fieldNode.asText();
            }
            else if (fieldName.equals(TYPE))
            {
                type = fieldNode.asText();
            }
View Full Code Here


            {
                idAsString = fieldNode.asText();
            }
            else if (fieldName.equals(TYPE))
            {
                type = fieldNode.asText();
            }
            else if (fieldNode.isArray())
            {
                // array containing either broker children or attribute values
                Iterator<JsonNode> elements = fieldNode.getElements();
View Full Code Here

    final Iterator<JsonNode> nodes = obj.path("Connector").iterator();
    while (nodes.hasNext()) {
      final ObjectNode node = (ObjectNode) nodes.next();
      final JsonNode current = node.path("RatedOutputkW");
      if (!current.isMissingNode() && !current.isNull()) {
        final double value = Double.parseDouble(current.asText());
        node.put("RatedOutputkW", value);
      }
      if (current.isNull()) {
        node.remove("RatedOutputkW");
      }
View Full Code Here

    final Iterator<JsonNode> nodes = obj.path("Connector").iterator();
    while (nodes.hasNext()) {
      final ObjectNode node = (ObjectNode) nodes.next();
      final JsonNode current = node.path("RatedOutputVoltage");
      if (!current.isMissingNode() && !current.isNull()) {
        final int value = Integer.parseInt(current.asText());
        node.put("RatedOutputVoltage", value);
      }
      if (current.isNull()) {
        node.remove("RatedOutputVoltage");
      }
View Full Code Here

    final Iterator<JsonNode> nodes = obj.path("Connector").iterator();
    while (nodes.hasNext()) {
      final ObjectNode node = (ObjectNode) nodes.next();
      final JsonNode current = node.path("RatedOutputCurrent");
      if (!current.isMissingNode() && !current.isNull()) {
        final int value = Integer.parseInt(current.asText());
        node.put("RatedOutputCurrent", value);
      }
      if (current.isNull()) {
        node.remove("RatedOutputCurrent");
      }
View Full Code Here

    final Iterator<JsonNode> nodes = obj.path("Connector").iterator();
    while (nodes.hasNext()) {
      final ObjectNode node = (ObjectNode) nodes.next();
      final JsonNode current = node.path("TetheredCable");
      if (!current.isMissingNode() && !current.isNull()) {
        final int value = Integer.parseInt(current.asText());
        node.put("TetheredCable", value);
      }
      if (current.isNull()) {
        node.remove("TetheredCable");
      }
View Full Code Here

    final Iterator<JsonNode> nodes = obj.path("Connector").iterator();
    while (nodes.hasNext()) {
      final ObjectNode node = (ObjectNode) nodes.next();
      final JsonNode current = node.path("ChargeMode");
      if (!current.isMissingNode() && !current.isNull()) {
        final int value = Integer.parseInt(current.asText());
        node.put("ChargeMode", value);
      }
      if (current.isNull()) {
        node.remove("ChargeMode");
      }
View Full Code Here

  private void convertLatitude(final JsonNode obj) {
    final ObjectNode node = (ObjectNode) obj.path("ChargeDeviceLocation");
    final JsonNode current = node.path("Latitude");
    if (!current.isMissingNode() && !current.isNull()) {
      final double value = Double.parseDouble(current.asText());
      node.put("Latitude", value);
    }
    if (current.isNull()) {
      node.remove("Latitude");
    }
View Full Code Here

  private void convertLongitude(final JsonNode obj) {
    final ObjectNode node = (ObjectNode) obj.path("ChargeDeviceLocation");
    final JsonNode current = node.path("Longitude");
    if (!current.isMissingNode() && !current.isNull()) {
      final double value = Double.parseDouble(current.asText());
      node.put("Longitude", value);
    }
    if (current.isNull()) {
      node.remove("Longitude");
    }
View Full Code Here

  private void convertDeviceControllerWebsite(final JsonNode obj) {
    final ObjectNode node = (ObjectNode) obj.path("DeviceController");
    final JsonNode current = node.path("Website");
    if (!current.isMissingNode() && !current.isNull()) {
      node.put("Website", this.createValueDatatype("uri", current.asText()));
    }
    if (current.isNull()) {
      node.remove("Website");
    }
  }
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.