本文整理了Java中com.fasterxml.jackson.databind.node.ObjectNode.removeAll()
方法的一些代码示例,展示了ObjectNode.removeAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectNode.removeAll()
方法的具体详情如下:
包路径:com.fasterxml.jackson.databind.node.ObjectNode
类名称:ObjectNode
方法名:removeAll
[英]Method for removing all field properties, such that this ObjectNode will contain no properties after call.
[中]方法删除所有字段属性,以便此ObjectNode在调用后不包含任何属性。
代码示例来源:origin: org.kitchen-eel/json-schema-validator
/**
* Clear all supplementary information
*
* <p>This <b>will not</b> reset the domain, keyword or message.</p>
*
* @return the builder
*/
public Builder clearInfo()
{
info.removeAll();
return this;
}
代码示例来源:origin: edu.byu.hbll/xml
((ObjectNode) doc).removeAll();
代码示例来源:origin: apache/knox
private void processEndArray() throws IOException {
Level child;
Level parent;
child = stack.pop();
if( child.equals(bufferingLevel) ) {
filterBufferedNode( child );
mapper.writeTree( generator, child.node );
bufferingLevel = null;
bufferingConfig = null;
} else if( bufferingLevel == null ) {
generator.writeEndArray();
if( !stack.isEmpty() ) {
parent = stack.peek();
switch( parent.node.asToken() ) {
case START_ARRAY:
((ArrayNode)parent.node ).removeAll();
break;
case START_OBJECT:
((ObjectNode)parent.node ).removeAll();
break;
default:
throw new IllegalStateException();
}
}
}
}
代码示例来源:origin: org.apache.knox/gateway-provider-rewrite
private void processEndObject() throws IOException {
Level child;
Level parent;
child = stack.pop();
if( bufferingLevel == child ) {
filterBufferedNode( child );
mapper.writeTree( generator, child.node );
bufferingLevel = null;
bufferingConfig = null;
} else if( bufferingLevel == null ) {
generator.writeEndObject();
if( !stack.isEmpty() ) {
parent = stack.peek();
switch( parent.node.asToken() ) {
case START_ARRAY:
((ArrayNode)parent.node ).removeAll();
break;
case START_OBJECT:
((ObjectNode)parent.node ).removeAll();
break;
default:
throw new IllegalStateException();
}
}
}
}
代码示例来源:origin: org.apache.knox/gateway-provider-rewrite
private void processEndArray() throws IOException {
Level child;
Level parent;
child = stack.pop();
if( bufferingLevel == child ) {
filterBufferedNode( child );
mapper.writeTree( generator, child.node );
bufferingLevel = null;
bufferingConfig = null;
} else if( bufferingLevel == null ) {
generator.writeEndArray();
if( !stack.isEmpty() ) {
parent = stack.peek();
switch( parent.node.asToken() ) {
case START_ARRAY:
((ArrayNode)parent.node ).removeAll();
break;
case START_OBJECT:
((ObjectNode)parent.node ).removeAll();
break;
default:
throw new IllegalStateException();
}
}
}
}
代码示例来源:origin: apache/knox
private void processEndObject() throws IOException {
Level child;
Level parent;
child = stack.pop();
if( child.equals(bufferingLevel) ) {
filterBufferedNode( child );
mapper.writeTree( generator, child.node );
bufferingLevel = null;
bufferingConfig = null;
} else if( bufferingLevel == null ) {
generator.writeEndObject();
if( !stack.isEmpty() ) {
parent = stack.peek();
switch( parent.node.asToken() ) {
case START_ARRAY:
((ArrayNode)parent.node ).removeAll();
break;
case START_OBJECT:
((ObjectNode)parent.node ).removeAll();
break;
default:
throw new IllegalStateException();
}
}
}
}
代码示例来源:origin: yahoo/fili
/**
* Given a JsonObjectNode, order the fields and recursively and replace context blocks with empty nodes.
*
* This method is recursive.
*
* @param node The root of the tree of json nodes.
* @param mapper The object mapper that creates and empty node.
* @param preserveContext Boolean indicating whether context should be omitted.
*/
public static void canonicalize(JsonNode node, ObjectMapper mapper, boolean preserveContext) {
if (node.isObject()) {
ObjectNode objectNode = ((ObjectNode) node);
if (objectNode.has("context") && !preserveContext) {
objectNode.replace("context", mapper.createObjectNode());
}
Iterator<Map.Entry<String, JsonNode>> iterator = objectNode.fields();
// collect and sort the entries
TreeMap<String, JsonNode> fieldMap = new TreeMap<>();
while (iterator.hasNext()) {
Map.Entry<String, JsonNode> entry = iterator.next();
fieldMap.put(entry.getKey(), entry.getValue());
// canonicalize all child nodes
canonicalize(entry.getValue(), mapper, preserveContext);
}
// remove the existing entries
objectNode.removeAll();
// replace the entries in sorted order
objectNode.setAll(fieldMap);
}
}
代码示例来源:origin: org.apache.knox/gateway-provider-rewrite
((ArrayNode)parent.node).removeAll();
} else {
((ObjectNode)parent.node).removeAll();
代码示例来源:origin: apache/knox
((ArrayNode)parent.node).removeAll();
} else {
((ObjectNode)parent.node).removeAll();
代码示例来源:origin: ingenieux/beanstalker
pathNode.with(d.getApi().getPath()).with(d.getApi().getMethodType()).removeAll();
内容来源于网络,如有侵权,请联系作者删除!