* or a subclass
* @return
*/
private static OpenSocialObject parseAsObject(JSONObject entryObject,
Class<? extends OpenSocialObject> clientClass) {
OpenSocialObject o = null;
try {
o = clientClass.newInstance();
} catch (InstantiationException e) {
throw new RuntimeException("Class not found " + clientClass);
} catch (IllegalAccessException e) {
throw new RuntimeException("Class not accessible " + clientClass);
}
Map<String, OpenSocialField> entryRepresentation =
createObjectRepresentation(entryObject);
for (Map.Entry<String,OpenSocialField> e : entryRepresentation.entrySet()) {
o.setField(e.getKey(), e.getValue());
}
return o;
}