public static <T> T newInstance(Constructor<T> c, Object... args) { try { return c.newInstance(args); } catch (InvocationTargetException e) { throw DataSetException.wrap(e.getCause()); } catch (Exception e) { throw DataSetException.wrap(e); } }
public static <T> T newInstance(Class<? extends T> type, String className) { try { return type.cast(loadClass(className).newInstance()); } catch (Exception e) { throw DataSetException.wrap(e); } }
public static <T> T newInstance(Class<? extends T> clazz) { try { return clazz.cast(clazz.newInstance()); } catch (Exception e) { throw DataSetException.wrap(e); } }