com.fasterxml.jackson.databind.node.ObjectNode.at()方法的使用及代码示例

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

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

ObjectNode.at介绍

暂无

代码示例

代码示例来源:origin: com.netflix.spinnaker.orca/orca-core

private JsonNode getPointer(String pointer, ObjectNode rootNode) {
 return pointer != null ? rootNode.at(pointer) : rootNode;
}

代码示例来源:origin: io.wcm.caravan/io.wcm.caravan.pipeline.impl

int getStatusCode() {
 return metadataNode.at("/statusCode").asInt(HttpStatus.SC_OK);
}

代码示例来源:origin: io.wcm.caravan/io.wcm.caravan.pipeline.impl

String getReasonString() {
 return metadataNode.at("/reason").asText("Not Found");
}

代码示例来源:origin: io.wcm.caravan/io.wcm.caravan.pipeline.impl

String getSources() {
 return metadataNode.at("/sources").toString();
}

代码示例来源:origin: io.wcm.caravan/io.wcm.caravan.pipeline.impl

String getGeneratedDate() {
 return metadataNode.at("/generated").asText();
}

代码示例来源:origin: io.syndesis.server/server-api-generator

public static ObjectNode resolveSchemaForReference(final ObjectNode json, final String title, final String reference) {
  final ObjectNode dereferenced = (ObjectNode) json.at(reference.substring(1));
  return createJsonSchema(title, dereferenced);
}

代码示例来源:origin: io.syndesis.server/server-connector-generator

public static ObjectNode resolveSchemaForReference(final ObjectNode json, final String title, final String reference) {
  final ObjectNode dereferenced = (ObjectNode) json.at(reference.substring(1));
  return createJsonSchema(title, dereferenced);
}

代码示例来源:origin: io.wcm.caravan/io.wcm.caravan.pipeline.impl

int getExpirySeconds() {
 if (!metadataNode.has("expires")) {
  return (int)TimeUnit.DAYS.toSeconds(365);
 }
 String expiryDate = metadataNode.at("/expires").asText();
 return CacheDateUtils.getSecondsUntil(expiryDate);
}

代码示例来源:origin: io.ratpack/ratpack-core

@Override
public <O> ConfigObject<O> getAsConfigObject(String pointer, TypeToken<O> type) {
 JsonNode node = pointer != null ? rootNode.at(pointer) : rootNode;
 if (node.isMissingNode()) {
  node = emptyNode;
 }
 try {
  JavaType javaType = objectMapper.getTypeFactory().constructType(type.getType());
  O value = objectMapper.readValue(new TreeTraversingParser(node, objectMapper), javaType);
  return new DefaultConfigObject<>(pointer, type, value);
 } catch (IOException ex) {
  throw Exceptions.uncheck(ex);
 }
}

代码示例来源:origin: Netflix/metacat

&& !objectNode.get().at(DELETION_COLUMN_PATH).isMissingNode()
&& !objectNode.get().at(PARTITION_COLUMN_DATA_TYPE_PATH).isMissingNode()) {
final String deleteColumn = objectNode.get().at(DELETION_COLUMN_PATH).textValue();
    objectNode.get().at(PARTITION_COLUMN_DATA_TYPE_PATH).textValue());

代码示例来源:origin: jurmous/etcd4j

/**
 * Gets the content of the key recursively as a JsonObject
 * @param path root path (i.e. /path1/path2)
 * @param etcdClient EtcdClient
 * @return JsonNode
 * @throws IOException
 * @throws EtcdAuthenticationException
 * @throws TimeoutException
 * @throws EtcdException
 */
public static JsonNode getAsJson(String path, EtcdClient etcdClient)
    throws IOException, EtcdAuthenticationException, TimeoutException, EtcdException {
 EtcdKeyGetRequest etcdKeyGetRequest = etcdClient.get(path).recursive();
 EtcdKeysResponse dataTree = etcdKeyGetRequest.send().get();
 ObjectNode jNode = JsonNodeFactory.instance.objectNode();
 if (dataTree.getNode().getNodes().isEmpty()) {
  iterateOverNodes(jNode, dataTree.getNode());
 } else {
  for (EtcdNode node : dataTree.getNode().getNodes()) {
   iterateOverNodes(jNode, node);
  }
 }
 return dotNotationToStandardJson(jNode.at(path));
}

相关文章

微信公众号

最新文章

更多