org.codehaus.jackson.JsonNode.findValues()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(139)

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

JsonNode.findValues介绍

[英]Method for finding JSON Object fields with specified name, and returning found ones as a List. Note that sub-tree search ends if a field is found, so possible children of result nodes are not included. If no matching fields are found in this node or its descendants, returns an empty List.
[中]方法查找具有指定名称的JSON对象字段,并将找到的字段作为列表返回。请注意,如果找到字段,则子树搜索将结束,因此不包括结果节点的可能子节点。如果在此节点或其子节点中未找到匹配字段,则返回空列表。

代码示例

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

@Override
public List<JsonNode> findValues(String fieldName, List<JsonNode> foundSoFar)
{
  if (_children != null) {
    for (JsonNode node : _children) {
      foundSoFar = node.findValues(fieldName, foundSoFar);
    }
  }
  return foundSoFar;
}

代码示例来源:origin: org.codehaus.jackson/jackson-core-asl

/**
 * Method for finding JSON Object fields with specified name, and returning
 * found ones as a List. Note that sub-tree search ends if a field is found,
 * so possible children of result nodes are <b>not</b> included.
 * If no matching fields are found in this node or its descendants, returns
 * an empty List.
 * 
 * @param fieldName Name of field to look for
 * 
 * @since 1.6
 */
public final List<JsonNode> findValues(String fieldName)
{
  List<JsonNode> result = findValues(fieldName, null);
  if (result == null) {
    return Collections.emptyList();
  }
  return result;
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

@Override
public List<JsonNode> findValues(String fieldName, List<JsonNode> foundSoFar)
{
  if (_children != null) {
    for (Map.Entry<String, JsonNode> entry : _children.entrySet()) {
      if (fieldName.equals(entry.getKey())) {
        if (foundSoFar == null) {
          foundSoFar = new ArrayList<JsonNode>();
        }
        foundSoFar.add(entry.getValue());
      } else { // only add children if parent not added
        foundSoFar = entry.getValue().findValues(fieldName, foundSoFar);
      }
    }
  }
  return foundSoFar;
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
public List<JsonNode> findValues(String fieldName, List<JsonNode> foundSoFar)
{
  if (_children != null) {
    for (JsonNode node : _children) {
      foundSoFar = node.findValues(fieldName, foundSoFar);
    }
  }
  return foundSoFar;
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Method for finding JSON Object fields with specified name, and returning
 * found ones as a List. Note that sub-tree search ends if a field is found,
 * so possible children of result nodes are <b>not</b> included.
 * If no matching fields are found in this node or its descendants, returns
 * an empty List.
 * 
 * @param fieldName Name of field to look for
 * 
 * @since 1.6
 */
public final List<JsonNode> findValues(String fieldName)
{
  List<JsonNode> result = findValues(fieldName, null);
  if (result == null) {
    return Collections.emptyList();
  }
  return result;
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
public List<JsonNode> findValues(String fieldName, List<JsonNode> foundSoFar)
{
  if (_children != null) {
    for (Map.Entry<String, JsonNode> entry : _children.entrySet()) {
      if (fieldName.equals(entry.getKey())) {
        if (foundSoFar == null) {
          foundSoFar = new ArrayList<JsonNode>();
        }
        foundSoFar.add(entry.getValue());
      } else { // only add children if parent not added
        foundSoFar = entry.getValue().findValues(fieldName, foundSoFar);
      }
    }
  }
  return foundSoFar;
}

代码示例来源:origin: com.barchart.wrap/barchart-wrap-jackson

@Override
public List<JsonNode> findValues(String fieldName, List<JsonNode> foundSoFar)
{
  if (_children != null) {
    for (JsonNode node : _children) {
      foundSoFar = node.findValues(fieldName, foundSoFar);
    }
  }
  return foundSoFar;
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

@Override
public List<JsonNode> findValues(String fieldName, List<JsonNode> foundSoFar)
{
  if (_children != null) {
    for (JsonNode node : _children) {
      foundSoFar = node.findValues(fieldName, foundSoFar);
    }
  }
  return foundSoFar;
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-lgpl

@Override
public List<JsonNode> findValues(String fieldName, List<JsonNode> foundSoFar)
{
  if (_children != null) {
    for (JsonNode node : _children) {
      foundSoFar = node.findValues(fieldName, foundSoFar);
    }
  }
  return foundSoFar;
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

/**
 * Method for finding JSON Object fields with specified name, and returning
 * found ones as a List. Note that sub-tree search ends if a field is found,
 * so possible children of result nodes are <b>not</b> included.
 * If no matching fields are found in this node or its descendants, returns
 * an empty List.
 * 
 * @param fieldName Name of field to look for
 * 
 * @since 1.6
 */
public final List<JsonNode> findValues(String fieldName)
{
  List<JsonNode> result = findValues(fieldName, null);
  if (result == null) {
    return Collections.emptyList();
  }
  return result;
}

代码示例来源:origin: com.barchart.wrap/barchart-wrap-jackson

/**
 * Method for finding JSON Object fields with specified name, and returning
 * found ones as a List. Note that sub-tree search ends if a field is found,
 * so possible children of result nodes are <b>not</b> included.
 * If no matching fields are found in this node or its descendants, returns
 * an empty List.
 * 
 * @param fieldName Name of field to look for
 * 
 * @since 1.6
 */
public final List<JsonNode> findValues(String fieldName)
{
  List<JsonNode> result = findValues(fieldName, null);
  if (result == null) {
    return Collections.emptyList();
  }
  return result;
}

代码示例来源:origin: com.atlassian.jira/jira-core

public List<ReadOnlyJsonNode> findValues(final String fieldName)
{
  return wrap(delegate.findValues(fieldName));
}

代码示例来源:origin: com.barchart.wrap/barchart-wrap-jackson

@Override
public List<JsonNode> findValues(String fieldName, List<JsonNode> foundSoFar)
{
  if (_children != null) {
    for (Map.Entry<String, JsonNode> entry : _children.entrySet()) {
      if (fieldName.equals(entry.getKey())) {
        if (foundSoFar == null) {
          foundSoFar = new ArrayList<JsonNode>();
        }
        foundSoFar.add(entry.getValue());
      } else { // only add children if parent not added
        foundSoFar = entry.getValue().findValues(fieldName, foundSoFar);
      }
    }
  }
  return foundSoFar;
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

@Override
public List<JsonNode> findValues(String fieldName, List<JsonNode> foundSoFar)
{
  if (_children != null) {
    for (Map.Entry<String, JsonNode> entry : _children.entrySet()) {
      if (fieldName.equals(entry.getKey())) {
        if (foundSoFar == null) {
          foundSoFar = new ArrayList<JsonNode>();
        }
        foundSoFar.add(entry.getValue());
      } else { // only add children if parent not added
        foundSoFar = entry.getValue().findValues(fieldName, foundSoFar);
      }
    }
  }
  return foundSoFar;
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-lgpl

@Override
public List<JsonNode> findValues(String fieldName, List<JsonNode> foundSoFar)
{
  if (_children != null) {
    for (Map.Entry<String, JsonNode> entry : _children.entrySet()) {
      if (fieldName.equals(entry.getKey())) {
        if (foundSoFar == null) {
          foundSoFar = new ArrayList<JsonNode>();
        }
        foundSoFar.add(entry.getValue());
      } else { // only add children if parent not added
        foundSoFar = entry.getValue().findValues(fieldName, foundSoFar);
      }
    }
  }
  return foundSoFar;
}

相关文章