Get the value object associated with a key. @param key A key string. @return The object associated with the key. @throws JSONException if the key is not found.
(String key)
| 445 | * @throws JSONException if the key is not found. |
| 446 | */ |
| 447 | public Object get(String key) throws JSONException { |
| 448 | if (key == null) { |
| 449 | throw new JSONException("Null key."); |
| 450 | } |
| 451 | Object object = opt(key); |
| 452 | if (object == null) { |
| 453 | throw new JSONException("JSONObject[" + quote(key) + |
| 454 | "] not found."); |
| 455 | } |
| 456 | return object; |
| 457 | } |
| 458 | |
| 459 | |
| 460 | /** |
no test coverage detected