本文整理了Java中org.json.JSONObject.sortedKeys()
方法的一些代码示例,展示了JSONObject.sortedKeys()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.sortedKeys()
方法的具体详情如下:
包路径:org.json.JSONObject
类名称:JSONObject
方法名:sortedKeys
[英]Get an enumeration of the keys of the JSONObject. The keys will be sorted alphabetically.
[中]获取JSONObject键的枚举。钥匙将按字母顺序排列。
代码示例来源:origin: com.belerweb/weibo4j-oauth2
public Tag(JSONObject json) throws WeiboException, JSONException {
if (!json.getString("id").isEmpty()) {
id = json.getString("id");
}
if (!json.getString("value").isEmpty()) {
value = json.getString("value");
} else {
Iterator<String> keys = json.sortedKeys();
if (keys.hasNext()) {
id = keys.next();
value = json.getString(id);
}
}
weight = json.getString("weight");
}
代码示例来源:origin: net.thucydides.plugins.jira/thucydides-jira-plugin
private Map<String, String> renderedFieldValuesFrom(JSONObject renderedFields) throws JSONException {
Map<String,String> renderedFieldMap = Maps.newHashMap();
for(Object key : Lists.newArrayList(renderedFields.sortedKeys())) {
String fieldName = (String) key;
String renderedValue = renderedFields.getString(fieldName);
if (getCustomFieldNameIndex().containsKey(fieldName)) {
fieldName = getCustomFieldNameIndex().get(key);
}
renderedFieldMap.put(fieldName, renderedValue);
}
return renderedFieldMap;
}
代码示例来源:origin: com.senseidb/sensei-core
private static Map<String, FacetAccessible> convertFacetMap(JSONObject jsonObject)
throws JSONException {
Map<String, FacetAccessible> map = new HashMap<String, FacetAccessible>();
Iterator<?> iter = jsonObject.sortedKeys();
while (iter.hasNext()) {
String fieldName = (String) iter.next();
JSONArray facetArr = (JSONArray) jsonObject.get(fieldName);
int length = facetArr.length();
BrowseFacet[] facets = new BrowseFacet[length];
for (int i = 0; i < length; i++) {
JSONObject facetObj = (JSONObject) facetArr.get(i);
BrowseFacet bf = new BrowseFacet();
bf.setFacetValueHitCount(facetObj
.getInt(SenseiSearchServletParams.PARAM_RESULT_FACET_INFO_COUNT));
bf.setValue(facetObj.getString(SenseiSearchServletParams.PARAM_RESULT_FACET_INFO_VALUE));
facets[i] = bf;
}
FacetAccessible fa = new MappedFacetAccessible(facets);
map.put(fieldName, fa);
}
return map;
}
代码示例来源:origin: de.twentyeleven.skysail/org.json-osgi
return "{}";
Iterator keys = sortedKeys();
StringBuffer sb = new StringBuffer("{");
int newindent = indent + indentFactor;
代码示例来源:origin: com.vaadin.external.json/json
return "{}";
Iterator keys = sortedKeys();
StringBuffer sb = new StringBuffer("{");
int newindent = indent + indentFactor;
代码示例来源:origin: org.datanucleus/datanucleus-api-json
return "{}";
Iterator keys = sortedKeys();
StringBuffer sb = new StringBuffer("{");
int newindent = indent + indentFactor;
代码示例来源:origin: com.vaadin/vaadin-shared-deps
return "{}";
Iterator keys = sortedKeys();
StringBuffer sb = new StringBuffer("{");
int newindent = indent + indentFactor;
代码示例来源:origin: org.json/com.springsource.org.json
return "{}";
Iterator keys = sortedKeys();
StringBuffer sb = new StringBuffer("{");
int newindent = indent + indentFactor;
代码示例来源:origin: uk.org.retep.tools/util
return "{}";
Iterator keys = sortedKeys();
StringBuffer sb = new StringBuffer("{");
int newindent = indent + indentFactor;
代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz
return "{}";
Iterator keys = sortedKeys();
StringBuffer sb = new StringBuffer("{");
int newindent = indent + indentFactor;
代码示例来源:origin: fernandospr/javapns-jdk16
return "{}";
Iterator keys = sortedKeys();
StringBuffer sb = new StringBuffer("{");
int newindent = indent + indentFactor;
代码示例来源:origin: org.daisy.libs/com.xmlcalabash
return "{}";
Iterator<String> keys = sortedKeys();
StringBuffer sb = new StringBuffer("{");
int newindent = indent + indentFactor;
代码示例来源:origin: com.xmlcalabash/xmlcalabash
return "{}";
Iterator<String> keys = sortedKeys();
StringBuffer sb = new StringBuffer("{");
int newindent = indent + indentFactor;
内容来源于网络,如有侵权,请联系作者删除!