Here you can find the source of getJsonObject(JsonObject object, String name)
public static JsonObject getJsonObject(JsonObject object, String name)
//package com.java2s; //License from project: Open Source License import javax.json.JsonObject; import javax.json.JsonValue; public class Main { public static JsonObject getJsonObject(JsonObject object, String name) { if (hasKey(object, name)) { return object.getJsonObject(name); }//w w w . ja v a2 s . c o m return null; } public static boolean hasKey(JsonObject object, String name) { JsonValue value = object.get(name); if ((value == null) || (value == JsonValue.NULL)) { return false; } return true; } }