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

x33g5p2x  于11个月前 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(25)

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

ArrayNode.set介绍

[英]Method that will set specified field, replacing old value, if any.
[中]方法,该方法将设置指定的字段,并替换旧值(如果有)。

代码示例

代码示例来源:origin: com.github.foodev/jsondiff

@Override
public void set(int index, JzonElement el) {
  wrapped.set(index, (JsonNode) el.unwrap());
}

代码示例来源:origin: algesten/jsondiff

@Override
public void set(int index, JzonElement el) {
  wrapped.set(index, (JsonNode) el.unwrap());
}

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

public void arraySetElementAt(final int i, final JsonRepresentation objectRepr) {
  ensureIsAnArrayAtLeastAsLargeAs(i);
  if (objectRepr.isArray()) {
    throw new IllegalArgumentException("Representation being set cannot be an array");
  }
  // can safely downcast because *this* representation is an array
  final ArrayNode arrayNode = (ArrayNode) jsonNode;
  arrayNode.set(i, objectRepr.asJsonNode());
}

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

public JsonRepresentation arraySetElementAt(final int i, final JsonRepresentation objectRepr) {
  ensureIsAnArrayAtLeastAsLargeAs(i+1);
  if (objectRepr.isArray()) {
    throw new IllegalArgumentException("Representation being set cannot be an array");
  }
  // can safely downcast because *this* representation is an array
  final ArrayNode arrayNode = (ArrayNode) jsonNode;
  arrayNode.set(i, objectRepr.asJsonNode());
  return this;
}

相关文章