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

x33g5p2x  于2022-01-15 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(203)

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

ArrayNode.arrayNode介绍

暂无

代码示例

代码示例来源:origin: redisson/redisson

/**
 * Method that will construct an ArrayNode and add it at the end
 * of this array node.
 *
 * @return Newly constructed ArrayNode
 */
public ArrayNode addArray()
{
  ArrayNode n  = arrayNode();
  _add(n);
  return n;
}

代码示例来源:origin: redisson/redisson

/**
 * Method for creating an array node, inserting it at the
 * specified point in the array,
 * and returning the <b>newly created array</b>
 * (note: NOT 'this' array)
 */
public ArrayNode insertArray(int index)
{
  ArrayNode n  = arrayNode();
  _insert(index, n);
  return n;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Method for creating an array node, inserting it at the
 * specified point in the array,
 * and returning the <b>newly created array</b>
 * (note: NOT 'this' array)
 */
public ArrayNode insertArray(int index)
{
  ArrayNode n  = arrayNode();
  _insert(index, n);
  return n;
}

代码示例来源:origin: com.jwebmp.jackson.core/jackson-databind

/**
 * Method for creating an array node, inserting it at the
 * specified point in the array,
 * and returning the <b>newly created array</b>
 * (note: NOT 'this' array)
 */
public ArrayNode insertArray(int index)
{
  ArrayNode n  = arrayNode();
  _insert(index, n);
  return n;
}

代码示例来源:origin: com.fasterxml.jackson.core/com.springsource.com.fasterxml.jackson.core.jackson-databind

/**
 * Method that will construct an ArrayNode and add it as a
 * field of this ObjectNode, replacing old value, if any.
 *
 * @return Newly constructed ArrayNode
 */
public ArrayNode addArray()
{
  ArrayNode n  = arrayNode();
  _add(n);
  return n;
}

代码示例来源:origin: Nextdoor/bender

/**
 * Method that will construct an ArrayNode and add it as a
 * field of this ObjectNode, replacing old value, if any.
 *
 * @return Newly constructed ArrayNode
 */
public ArrayNode addArray()
{
  ArrayNode n  = arrayNode();
  _add(n);
  return n;
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

/**
 * Method for creating an array node, inserting it at the
 * specified point in the array,
 * and returning the <b>newly created array</b>
 * (note: NOT 'this' array)
 */
public ArrayNode insertArray(int index)
{
  ArrayNode n  = arrayNode();
  _insert(index, n);
  return n;
}

代码示例来源:origin: com.jwebmp.jackson.core/jackson-databind

/**
 * Method that will construct an ArrayNode and add it at the end
 * of this array node.
 *
 * @return Newly constructed ArrayNode
 */
public ArrayNode addArray()
{
  ArrayNode n  = arrayNode();
  _add(n);
  return n;
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * Method that will construct an ArrayNode and add it as a
 * field of this ObjectNode, replacing old value, if any.
 *
 * @return Newly constructed ArrayNode
 */
public ArrayNode addArray()
{
  ArrayNode n  = arrayNode();
  _add(n);
  return n;
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * Method for creating an array node, inserting it at the
 * specified point in the array,
 * and returning the <b>newly created array</b>
 * (note: NOT 'this' array)
 */
public ArrayNode insertArray(int index)
{
  ArrayNode n  = arrayNode();
  _insert(index, n);
  return n;
}

代码示例来源:origin: Nextdoor/bender

/**
 * Method for creating an array node, inserting it at the
 * specified point in the array,
 * and returning the <b>newly created array</b>
 * (note: NOT 'this' array)
 */
public ArrayNode insertArray(int index)
{
  ArrayNode n  = arrayNode();
  _insert(index, n);
  return n;
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

/**
 * Method that will construct an ArrayNode and add it as a
 * field of this ObjectNode, replacing old value, if any.
 *
 * @return Newly constructed ArrayNode
 */
public ArrayNode addArray()
{
  ArrayNode n  = arrayNode();
  _add(n);
  return n;
}

代码示例来源:origin: com.fasterxml.jackson.core/com.springsource.com.fasterxml.jackson.core.jackson-databind

/**
 * Method for creating an array node, inserting it at the
 * specified point in the array,
 * and returning the <b>newly created array</b>
 * (note: NOT 'this' array)
 */
public ArrayNode insertArray(int index)
{
  ArrayNode n  = arrayNode();
  _insert(index, n);
  return n;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Method that will construct an ArrayNode and add it as a
 * field of this ObjectNode, replacing old value, if any.
 *
 * @return Newly constructed ArrayNode
 */
public ArrayNode addArray()
{
  ArrayNode n  = arrayNode();
  _add(n);
  return n;
}

代码示例来源:origin: io.digdag/digdag-standards

public static ArrayNode resolveSecrets(ArrayNode node, SecretProvider secrets)
{
  ArrayNode newNode = node.arrayNode();
  node.elements().forEachRemaining(element -> newNode.add(resolveSecrets(element, secrets)));
  return newNode;
}

代码示例来源:origin: com.palantir.config.crypto/encrypted-config-value-module

@Override
public JsonNode visitArray(ArrayNode arrayNode) {
  ArrayNode newArrayNode = arrayNode.arrayNode();
  int index = 0;
  for (JsonNode node : arrayNode) {
    try {
      newArrayNode.add(JsonNodeVisitors.dispatch(node, this));
    } catch (StringSubstitutionException e) {
      throw e.extend(index);
    }
    index++;
  }
  return newArrayNode;
}

代码示例来源:origin: com.reprezen.genflow/genflow-api

private static JsonNode deepCopyArray(ArrayNode node, IdentityHashMap<JsonNode, JsonNode> copies) {
    ArrayNode copy = node.arrayNode();
    copies.put(node, copy);
    for (JsonNode element : iterable(node.elements())) {
      copy.add(deepCopy(element, copies));
    }
    return copy;
  }
}

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

private ArrayNode evalArrayRecursive(ArrayNode array)
  throws IOException
{
  ArrayNode built = array.arrayNode();
  for (JsonNode value : array) {
    JsonNode evaluated;
    if (value.isObject()) {
      evaluated = evalObjectRecursive((ObjectNode) value);
    }
    else if (value.isArray()) {
      evaluated = evalArrayRecursive((ArrayNode) value);
    }
    else if (value.isTextual() && value.textValue().startsWith("!include:")) {
      evaluated = include(value.textValue());
    }
    else {
      evaluated = value;
    }
    built.add(evaluated);
  }
  return built;
}

代码示例来源:origin: io.digdag/digdag-standards

private static JsonNode resolveSecrets(JsonNode node, SecretProvider secrets)
{
  if (node.isObject()) {
    ObjectNode object = (ObjectNode) node;
    ObjectNode newObject = object.objectNode();
    object.fields().forEachRemaining(entry -> newObject.set(
        UserSecretTemplate.of(entry.getKey()).format(secrets),
        resolveSecrets(entry.getValue(), secrets)));
    return newObject;
  }
  else if (node.isArray()) {
    ArrayNode array = (ArrayNode) node;
    ArrayNode newArray = array.arrayNode();
    array.elements().forEachRemaining(element -> newArray.add(resolveSecrets(element, secrets)));
    return newArray;
  }
  else if (node.isTextual()) {
    return new TextNode(UserSecretTemplate.of(node.textValue()).format(secrets));
  }
  else {
    return node;
  }
}

代码示例来源:origin: io.swagger/swagger-compat-spec-parser

/**
 * Apply a migrator to all elements of the array at the current pointer
 *
 * <p>Note that if the migrator fails to apply to at least one element, the
 * original array is left untouched; its elements are replaced if and only
 * if the migrator applies successfully to <strong>all</strong> elements.
 * </p>
 *
 * @param migrator the migrator to apply
 * @throws SwaggerMigrationException current node is not a JSON Array, or
 *                                   migrator failed to apply to at least one array element
 */
public void applyMigratorToElements(final SwaggerMigrator migrator)
    throws SwaggerMigrationException {
  if (!currentNode.isArray()) {
    throw new SwaggerMigrationException();
  }
  final ArrayNode array = (ArrayNode) currentNode;
  final ArrayNode transformed = array.arrayNode();
  for (final JsonNode element : array) {
    transformed.add(migrator.migrate(element));
  }
  array.removeAll().addAll(transformed);
}

相关文章