}
} else {
return null;
}
} catch( ClassNotFoundException ex ) {
throw new JSONException( String.format("%s: Could not find class %s", context.getCurrentPath(), ex.getMessage() ), ex);
} catch (IllegalAccessException e) {
throw new JSONException( String.format("%s: Could not instantiate class %s", context.getCurrentPath(), clazz.getName() ), e );
} catch (InstantiationException e) {
throw new JSONException( String.format("%s: Problem while instantiating class %s", context.getCurrentPath(), clazz.getName() ), e );
} catch (NoSuchMethodException e) {
throw new JSONException( String.format("%s: Could not find a no-arg constructor for %s", context.getCurrentPath(), clazz.getName() ), e );
} catch (InvocationTargetException e) {
throw new JSONException( String.format("%s: Problem while invoking the no-arg constructor for %s", context.getCurrentPath(), clazz.getName() ), e );
}
}