Examples of asText()


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

    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

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

    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

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

    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

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

    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

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

    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

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

  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

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

  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

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

  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

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

  private void convertDeviceOwnerWebsite(final JsonNode obj) {
    final ObjectNode node = (ObjectNode) obj.path("DeviceOwner");
    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

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

    if (!value.isTextual()) {
      throw new ParseException("Invalid property'" + OCCUR_PROPERTY + "': value is not textual");
    }

    try {
      final Occur occur = Occur.valueOf(value.asText());
      switch (occur) {
        case MUST:
          return Modifier.MOD_REQ;

        case SHOULD:
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.