public String getRel() { return asObjectNode().path("rel").getTextValue(); }
public String getHref() { return asObjectNode().path("href").getTextValue(); }
public String getRel() { return asObjectNode().path("rel").getTextValue(); }
public MediaType getType() { final String typeStr = asObjectNode().path("type").getTextValue(); if (typeStr == null) { return MediaType.APPLICATION_JSON_TYPE; } return MediaType.valueOf(typeStr); }
public MediaType getType() { final String typeStr = asObjectNode().path("type").getTextValue(); if (typeStr == null) { return MediaType.APPLICATION_JSON_TYPE; } return MediaType.valueOf(typeStr); }
public RestfulHttpMethod getHttpMethod() { final String methodStr = asObjectNode().path("method").getTextValue(); return RestfulHttpMethod.valueOf(methodStr); }
public HttpMethod getHttpMethod() { final String methodStr = asObjectNode().path("method").getTextValue(); return HttpMethod.valueOf(methodStr); }
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 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 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 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"); } } }
@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 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 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 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 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 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 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"); } }