Hi,
Is there anything like this?
Boolean v = (Boolean) JSONUtils.getValue(jsonObject, "
schedules.2008.weeks.1.victory");
It'd be nice if I could do this and not have to check for nulls each time.
For instance, I've been doing this:
Date d = null;
try {
jsonObject.optJSONObject
("schedules").optJSONObject.("2008").optJSONObject("weeks").optJSONObject("1").optBoolean("victory");
} catch (Exception e) {
// do nothing
}
Any ideas? If not, I might write my own simple little util that pretty much
does the above.
Thanks,
Ben Anderson
|