MCPcopy
hub / github.com/nICEnnnnnnnLee/BilibiliDown / toJSONArray

Method toJSONArray

src/org/json/JSONObject.java:2236–2245  ·  view source on GitHub ↗

Produce a JSONArray containing the values of the members of this JSONObject. @param names A JSONArray containing a list of key strings. This determines the sequence of the values in the result. @return A JSONArray of values. @throws JSONException If any of the valu

(JSONArray names)

Source from the content-addressed store, hash-verified

2234 * If any of the values are non-finite numbers.
2235 */
2236 public JSONArray toJSONArray(JSONArray names) throws JSONException {
2237 if (names == null || names.isEmpty()) {
2238 return null;
2239 }
2240 JSONArray ja = new JSONArray();
2241 for (int i = 0; i < names.length(); i += 1) {
2242 ja.put(this.opt(names.getString(i)));
2243 }
2244 return ja;
2245 }
2246
2247 /**
2248 * Make a JSON text of this JSONObject. For compactness, no whitespace is

Callers 1

toStringMethod · 0.95

Calls 5

putMethod · 0.95
optMethod · 0.95
isEmptyMethod · 0.45
lengthMethod · 0.45
getStringMethod · 0.45

Tested by

no test coverage detected