Get the JSONObject value associated with a key. @webref jsonobject:method @brief Gets the JSONObject value associated with a key @param key a key string @return A JSONObject which is the value or null if not available. @throws RuntimeException if the value is not a JSONObject. @see JSONObject#getJS
(String key)
| 819 | * @see JSONObject#setJSONArray(String, JSONArray) |
| 820 | */ |
| 821 | public JSONObject getJSONObject(String key) { |
| 822 | Object object = this.get(key); |
| 823 | if (object == null) { |
| 824 | return null; |
| 825 | } |
| 826 | if (object instanceof JSONObject) { |
| 827 | return (JSONObject)object; |
| 828 | } |
| 829 | throw new RuntimeException("JSONObject[" + quote(key) + "] is not a JSONObject."); |
| 830 | } |
| 831 | |
| 832 | |
| 833 | // /** |