org.codehaus.jackson.node.ObjectNode.path()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中org.codehaus.jackson.node.ObjectNode.path()方法的一些代码示例,展示了ObjectNode.path()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectNode.path()方法的具体详情如下:
包路径:org.codehaus.jackson.node.ObjectNode
类名称:ObjectNode
方法名:path

ObjectNode.path介绍

暂无

代码示例

代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-applib

public String getRel() {
  return asObjectNode().path("rel").getTextValue();
}

代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-applib

public String getHref() {
  return asObjectNode().path("href").getTextValue();
}

代码示例来源:origin: org.apache.isis.viewer/json-applib

public String getRel() {
  return asObjectNode().path("rel").getTextValue();
}

代码示例来源:origin: org.apache.isis.viewer/json-applib

public MediaType getType() {
  final String typeStr = asObjectNode().path("type").getTextValue();
  if (typeStr == null) {
    return MediaType.APPLICATION_JSON_TYPE;
  }
  return MediaType.valueOf(typeStr);
}

代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-applib

public MediaType getType() {
  final String typeStr = asObjectNode().path("type").getTextValue();
  if (typeStr == null) {
    return MediaType.APPLICATION_JSON_TYPE;
  }
  return MediaType.valueOf(typeStr);
}

代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-applib

public RestfulHttpMethod getHttpMethod() {
  final String methodStr = asObjectNode().path("method").getTextValue();
  return RestfulHttpMethod.valueOf(methodStr);
}

代码示例来源:origin: org.apache.isis.viewer/json-applib

public HttpMethod getHttpMethod() {
  final String methodStr = asObjectNode().path("method").getTextValue();
  return HttpMethod.valueOf(methodStr);
}

代码示例来源:origin: rdelbru/SIREn

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");
  }
 }
}

代码示例来源:origin: sirensolutions/siren

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");
  }
 }
}

代码示例来源:origin: sirensolutions/siren

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");
  }
 }
}

代码示例来源:origin: rdelbru/SIREn

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");
  }
 }
}

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.enhancer.nlp.json

@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());
  }
}

代码示例来源:origin: rdelbru/SIREn

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");
 }
}

代码示例来源:origin: sirensolutions/siren

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");
 }
}

代码示例来源:origin: rdelbru/SIREn

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");
 }
}

代码示例来源:origin: sirensolutions/siren

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");
 }
}

代码示例来源:origin: rdelbru/SIREn

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");
 }
}

代码示例来源:origin: rdelbru/SIREn

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");
 }
}

代码示例来源:origin: sirensolutions/siren

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");
 }
}

代码示例来源:origin: sirensolutions/siren

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");
 }
}

相关文章