本文整理了Java中net.sf.json.JSONObject.discard()
方法的一些代码示例,展示了JSONObject.discard()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.discard()
方法的具体详情如下:
包路径:net.sf.json.JSONObject
类名称:JSONObject
方法名:discard
暂无
代码示例来源:origin: gooddata/GoodData-CL
public JSONObject discard(String key) {
return jsonObject.discard(key);
}
代码示例来源:origin: org.geoserver.community/gs-wps-remote
serviceResultJSON.discard((String) keyToDiscard);
代码示例来源:origin: gooddata/GoodData-CL
throw new GdcRestApiException("The JSON object doesn't contain the meta tag object=" + jsonObject.toString());
m.discard("author");
m.discard("contributor");
m.discard("created");
m.discard("updated");
c.discard("results");
c.discard("entries");
代码示例来源:origin: gooddata/GoodData-CL
/**
* Strips all keys that should not be sent to the create method
*/
public void stripKeysForCreate() {
Iterator keys = jsonObject.keys();
if (keys.hasNext()) {
String rootKey = (String) keys.next();
JSONObject r = jsonObject.getJSONObject(rootKey);
if (r == null || r.isNullObject() || r.isEmpty()) {
l.debug("The JSON object doesn't contain the root object=" + jsonObject.toString());
throw new GdcRestApiException("The JSON object doesn't contain the root object=" + jsonObject.toString());
}
JSONObject m = r.getJSONObject("meta");
if (m == null || m.isNullObject() || m.isEmpty()) {
l.debug("The JSON object doesn't contain the meta tag object=" + jsonObject.toString());
throw new GdcRestApiException("The JSON object doesn't contain the meta tag object=" + jsonObject.toString());
}
m.discard("uri");
} else {
l.debug("The JSON object doesn't contain any root object=" + jsonObject.toString());
throw new GdcRestApiException("The JSON object doesn't contain any root object=" + jsonObject.toString());
}
}
内容来源于网络,如有侵权,请联系作者删除!