示例#1
0
 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);
   }
 }
示例#2
0
 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);
   }
 }
示例#3
0
 public static <T> T newInstance(Class<? extends T> clazz) {
   try {
     return clazz.cast(clazz.newInstance());
   } catch (Exception e) {
     throw DataSetException.wrap(e);
   }
 }