public String getString(String key) throws JSONException { JSONValue v = get(key); if (v == null) throw new JSONException(JSONErrorCode.KeyIsNotFound, key); JSONString s = v.getJSONString(); if (s == null) throw new JSONException(JSONErrorCode.NotAJSONString, v.toString()); return s.getValue(); }