private static JSONObject merge(JSONObject o1, JSONObject o2) { if (o2 == null) return o1; for (String key : o1.keySet()) { Object value1 = o1.get(key); Object value2 = o2.get(key); if (value2 == null) continue; if (value1 instanceof JSONArray) { o1.put(key, merge((JSONArray) value1, value2)); continue; } if (value1 instanceof JSONObject) { o1.put(key, merge((JSONObject) value1, value2)); continue; } if (value1.equals(value2)) continue; if (value1.getClass() .equals(value2.getClass())) throw new RuntimeException("JSON merge can not merge two " + value1.getClass().getName() + " Object together"); throw new RuntimeException("JSON merge can not merge " + value1.getClass().getName() + " with " + value2.getClass().getName()); } for (String key : o2.keySet()) { if (o1.containsKey(key)) continue; o1.put(key, o2.get(key)); } return o1; }
private static JSONObject merge(JSONObject o1, JSONObject o2) { if (o2 == null) return o1; for (String key : o1.keySet()) { Object value1 = o1.get(key); Object value2 = o2.get(key); if (value2 == null) continue; if (value1 instanceof JSONArray) { o1.put(key, merge((JSONArray) value1, value2)); continue; } if (value1 instanceof JSONObject) { o1.put(key, merge((JSONObject) value1, value2)); continue; } if (value1.equals(value2)) continue; if (value1.getClass() .equals(value2.getClass())) throw new RuntimeException("JSON merge can not merge two " + value1.getClass().getName() + " Object together"); throw new RuntimeException("JSON merge can not merge " + value1.getClass().getName() + " with " + value2.getClass().getName()); } for (String key : o2.keySet()) { if (o1.containsKey(key)) continue; o1.put(key, o2.get(key)); } return o1; }
@Override public IProfile[] read() throws Exception { FileReader fileReader = new FileReader(dest); JSONObject root = (JSONObject) JSONValue.parse(fileReader); fileReader.close(); JSONObject authDatabase = (JSONObject) root.get("authenticationDatabase"); IProfile[] result = new IProfile[authDatabase.size()]; int i = 0; for (String key : authDatabase.keySet()) { result[i] = new YDAuthProfile((JSONObject) authDatabase.get(key)); ++i; } return result; }
private boolean parseKVJS(JSONObject json) { try { Iterator<String> keys = json.keySet().iterator(); while (keys.hasNext()) { String key = keys.next(); String val = json.get(key).toString(); Object k, v; if (this.pKey != null && this.pKey.length() > 0) { k = DataProcessor.Persistable.dePrefix(AES256.decode(this.pKey, key)); v = DataProcessor.Persistable.dePrefix(AES256.decode(this.pKey, val)); } else { k = DataProcessor.Persistable.dePrefix(key); v = DataProcessor.Persistable.dePrefix(val); } this.dMap.put(k, v); } return true; } catch (Exception e) { QKVLogger.ex(e); return false; } }
for (final String field : kibanaPermission.keySet()) {
JSONObject object = parser.parse(line, JSONObject.class); if (object != null) { for (String key : object.keySet()) { Object val = object.get(key); if (val == null)
JSONObject object = parser.parse(line, JSONObject.class); if (object != null) { for (String key : object.keySet()) { Object val = object.get(key); if (val == null)
JSONObject object = (JSONObject) parser.parse(data); item = DataFactory.create(); for (String k : object.keySet()) { item.put(k, (Serializable) object.get(k));
JSONObject object = parser.parse(line, JSONObject.class); if (object != null) { for (String key : object.keySet()) { Object val = object.get(key); if (val == null)
return ((JSONObject) jsonPathResult).keySet(); } else { return Collections.emptySet();
JSONObject object = (JSONObject) parser.parse(data); item = DataFactory.create(); for (String k : object.keySet()) { item.put(k, (Serializable) object.get(k));
for (String key : object.keySet()) { Object data = object.get(key); if (data instanceof Serializable) {
for (String key : object.keySet()) { Object data = object.get(key); if (data instanceof Serializable) {
for (String key : object.keySet()) { Object data = object.get(key); if (data instanceof Serializable) {
public Library(JSONObject json) { name = json.get("name").toString(); if (json.containsKey("natives")) { JSONObject nativesObj = (JSONObject) json.get("natives"); for (String nativeKey : nativesObj.keySet()) { String key = nativeKey; String value = nativesObj.get(nativeKey).toString(); natives.put(key, value); } } if (json.containsKey("rules")) { JSONArray rulz = (JSONArray) json.get("rules"); for (int i = 0; i < rulz.size(); ++i) { rules.add(new Rule((JSONObject) rulz.get(i))); } } if (json.containsKey("extract")) { extractRules = new LibraryExtractRules((JSONObject) json.get("extract")); } if (json.containsKey("url")) { url = json.get("url").toString(); } }
for(final String name: jsonObject.keySet()) {
for (final String name: json.keySet()) {
for (final String field : dlsPermission.keySet()) {
for (final String name: jsonObject.keySet()) {
for(final String name: jsonObject.keySet()) {