public static JSONObject getChild ( JSONObject jsonObject , String key ) throws JSONException { checkArguments ( jsonObject , key ) ; JSONValue value = jsonObject . get ( key ) ; if ( value != null ) { if ( value . isObject ( ) != null ) { return value . isObject ( ) ; } else if ( value . isNull ( ) != null ) { return null ; } throw new JSONException ( "Child is not a JSONObject, but a: " + value . getClass ( ) ) ; } return null ; }
Get a child JSON object from a parent JSON object .