}
}
}
} else {
// Dunno?
throw new JSONException("Unknown type: [" + vClazz.getName() + "]");
}
} else {
try {
m = clazz.getMethod(setter, null);
} catch (NoSuchMethodException nmex){
// Ignore, no setter.
}
}
if (m != null) {
m.invoke(obj, new Object[] { val });
}
}
}
}
} else {
throw new JSONException("Could not locate class: [" + cName + "]");
}
} catch (Exception ex) {
if (ex instanceof JSONException) {
throw (JSONException)ex;
} else {
JSONException jex = new JSONException("Error in converting JSON to Java Class");
jex.initCause(ex);
throw jex;
}
}
} else {
throw new JSONException("Provided JSONObject does not contain attributes '_classname' or '_type'");
}
}
return obj;
}