本文整理了Java中org.codehaus.jettison.json.JSONObject.accumulate()
方法的一些代码示例,展示了JSONObject.accumulate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.accumulate()
方法的具体详情如下:
包路径:org.codehaus.jettison.json.JSONObject
类名称:JSONObject
方法名:accumulate
[英]Accumulate values under a key. It is similar to the put method except that if there is already an object stored under the key then a JSONArray is stored under the key to hold all of the accumulated values. If there is already a JSONArray, then the new value is appended to it. In contrast, the put method replaces the previous value.
[中]在键下累积值。它与put方法类似,只是如果已经有一个对象存储在该键下,那么会在该键下存储一个JSONArray来保存所有累积值。如果已经有一个JSONArray,那么新值将附加到它。相反,put方法将替换以前的值。
代码示例来源:origin: com.couchbase.client/couchbase-client
jsonDesign.accumulate("language", language);
jsonView.accumulate("map", view.getMap());
if(!view.getReduce().isEmpty()) {
jsonView.accumulate("reduce", view.getReduce());
jsonViews.accumulate(view.getName(), jsonView);
jsonDesign.accumulate("views", jsonViews);
jsonSpatialViews.accumulate(spatialView.getName(),
spatialView.getMap());
jsonDesign.accumulate("spatial", jsonSpatialViews);
代码示例来源:origin: ModeShape/modeshape
@Override
public JSONObject toJSON() throws JSONException {
JSONObject content = new JSONObject();
content.put("mixin", isMixin);
content.put("abstract", isAbstract);
content.put("queryable", isQueryable);
content.put("hasOrderableChildNodes", hasOrderableChildNodes);
if (!propertyTypes.isEmpty()) {
for (RestPropertyType restPropertyType : propertyTypes) {
content.accumulate("propertyDefinitions", restPropertyType.toJSON());
}
}
if (!superTypesLinks.isEmpty()) {
content.put("superTypes", superTypesLinks);
}
if (!subTypesLinks.isEmpty()) {
content.put("subTypes", subTypesLinks);
}
JSONObject result = new JSONObject();
result.put(name, content);
return result;
}
}
代码示例来源:origin: inchaincodes/inchain
for(int j=0; j<codeList.length();j++) {
JSONObject rs = rpcService.bindAntifake(codeList.get(j).toString(), productHash, trpw, address);
results.accumulate(codeList.get(j).toString(),rs);
内容来源于网络,如有侵权,请联系作者删除!