本文整理了Java中org.codehaus.jackson.node.ObjectNode.putAll()
方法的一些代码示例,展示了ObjectNode.putAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectNode.putAll()
方法的具体详情如下:
包路径:org.codehaus.jackson.node.ObjectNode
类名称:ObjectNode
方法名:putAll
[英]Method for adding given properties to this object node, overriding any existing values for those properties.
[中]方法将给定属性添加到此对象节点,并覆盖这些属性的任何现有值。
代码示例来源:origin: oVirt/ovirt-engine
/**
* Applies custom (user-defined) configuration on top of default (descriptor-defined) configuration, and returns the
* resulting JSON object.
*/
public ObjectNode mergeConfiguration() {
JsonNode descriptorConfigNode = descriptorNode.path(ATT_CONFIG);
ObjectNode result = nodeFactory.objectNode();
// Apply default configuration, if any
if (!descriptorConfigNode.isMissingNode() && descriptorConfigNode.isObject()) {
result.putAll((ObjectNode) descriptorConfigNode);
}
// Apply custom configuration, if any
JsonNode customConfigNode = configurationNode.path(ATT_CONFIG);
if (customConfigNode != null && !customConfigNode.isMissingNode() && customConfigNode.isObject()) {
result.putAll((ObjectNode) customConfigNode);
}
return result;
}
代码示例来源:origin: rdelbru/SIREn
@Override
ObjectNode toJson() {
final ObjectNode obj = mapper.createObjectNode();
final ArrayNode bool = obj.putArray(BooleanPropertyParser.BOOLEAN_PROPERTY);
for (final QueryClause clause : clauses) {
final ObjectNode e = bool.addObject();
e.put(OccurPropertyParser.OCCUR_PROPERTY, clause.getOccur().toString());
e.putAll(clause.getQuery().toJson());
}
return obj;
}
代码示例来源:origin: sirensolutions/siren
@Override
public ObjectNode toJson() {
final ObjectNode obj = mapper.createObjectNode();
ObjectNode bool = obj.putObject(BooleanPropertyParser.BOOLEAN_PROPERTY);
// add boost
if (this.hasBoost()) {
bool.put(BoostPropertyParser.BOOST_PROPERTY, this.getBoost());
}
// add slop
if (this.hasSlop()) {
bool.put(SlopPropertyParser.SLOP_PROPERTY, this.getSlop());
}
// add inOrder
if (this.hasInOrder()) {
bool.put(InOrderPropertyParser.IN_ORDER_PROPERTY, this.getInOrder());
}
// add clauses
ArrayNode array = bool.putArray(ClausePropertyParser.CLAUSE_PROPERTY);
for (final QueryClause clause : clauses) {
final ObjectNode e = array.addObject();
e.put(OccurPropertyParser.OCCUR_PROPERTY, clause.getOccur().toString());
e.putAll(clause.getQuery().toJson());
}
return obj;
}
代码示例来源:origin: sirensolutions/siren
e.putAll(clause.getQuery().toJson());
e.put(OccurPropertyParser.OCCUR_PROPERTY, clause.getOccur().toString());
e.put(LevelPropertyParser.LEVEL_PROPERTY, ((DescendantQueryClause) clause).getLevel());
e.putAll(clause.getQuery().toJson());
代码示例来源:origin: rdelbru/SIREn
e.putAll(clause.getQuery().toJson());
e.put(OccurPropertyParser.OCCUR_PROPERTY, clause.getOccur().toString());
e.put(LevelPropertyParser.LEVEL_PROPERTY, ((DescendantQueryClause) clause).getLevel());
e.putAll(clause.getQuery().toJson());
内容来源于网络,如有侵权,请联系作者删除!