Here you can find the source of getJsonArray(JsonObject object, String name)
public static JsonArray getJsonArray(JsonObject object, String name)
//package com.java2s; //License from project: Open Source License import javax.json.JsonArray; import javax.json.JsonObject; import javax.json.JsonValue; public class Main { public static JsonArray getJsonArray(JsonObject object, String name) { if (hasKey(object, name)) { return object.getJsonArray(name); }/*from ww w .j a v a 2s . c o m*/ return null; } public static JsonArray getJsonArray(JsonArray object, int index) { if (object == null) return null; if (object.size() <= index) return null; JsonValue value = object.get(index); if ((value == null) || (value == JsonValue.NULL)) { return null; } return object.getJsonArray(index); } public static boolean hasKey(JsonObject object, String name) { JsonValue value = object.get(name); if ((value == null) || (value == JsonValue.NULL)) { return false; } return true; } }