For IntelliJ IDEA and
Android Studio


private void myMethod () {ObjectNode o =
JsonNodeFactory jsonNodeFactory;jsonNodeFactory.objectNode()
- AI code suggestions by Codota
}
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"); } }
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"); } }
@Override public NerTag parse(ObjectNode jValue, AnalysedText at) { JsonNode tag = jValue.path("tag"); if(!tag.isTextual()){ throw new IllegalStateException("Unable to parse NerTag. The value of the " +"'tag' field MUST have a textual value (json: "+jValue+")"); } JsonNode uri = jValue.path("uri"); if(uri.isTextual()){ return new NerTag(tag.getTextValue(), new IRI(uri.getTextValue())); } else { return new NerTag(tag.getTextValue()); } }
private void convertRatedOutputVoltage(final JsonNode obj) { 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"); } } }
private void convertRatedOutputkW(final JsonNode obj) { 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"); } } }
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"); } }
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"); } }
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"); } }
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"); } }
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"); } }
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"); } }
private void convertRatedOutputCurrent(final JsonNode obj) { 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"); } } }
private void convertTetheredCable(final JsonNode obj) { 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"); } } }
private void convertChargeMode(final JsonNode obj) { 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"); } } }
private void convertChargeMode(final JsonNode obj) { 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"); } } }