@Test public void testNewInstance_01() { Person p = ReflectionUtil.newInstance(Person.class, "John Smith"); assertEquals("01", "John Smith", p.getName()); }
public static <T> T newInstance(Class<T> cls) { return newInstance(cls, new Class[] {}, new Object[] {}); }
ReflectionUtil { public static <T> T newInstance(Class<T> cls) { return newInstance(cls, new Class[] {}, new Object[] {}); } }
ReflectionUtil { public static <T> T newInstance(Class<T> cls) { return newInstance(cls, new Class[] {}, new Object[] {}); } private  ReflectionUtil(); }
ReflectionUtil { public static <T> T newInstance(Class<T> cls) { return newInstance(cls, new Class[] {}, new Object[] {}); } private  ReflectionUtil(); static T newInstance(Class<T> cls); static T newInstance(Class<T> cls, Object... args); static T newInstance(Class<T> cls, Class<?>[] paramTypes, Object... args); static void set(Object obj, String field, Object value); static void setStatic(Class<?> cls, String field, Object value); @SuppressWarnings("unchecked") static T get(Object obj, String field); @SuppressWarnings("unchecked") static T getStatic(Class<?> cls, String field); @SuppressWarnings("unchecked") static T call(Object obj, String method); static T call(Object obj, String method, Object... args); @SuppressWarnings("unchecked") static T call(Object obj, String method, Class<?>[] paramTypes, Object... args); @SuppressWarnings("unchecked") static T callStatic(Class<?> cls, String method); static T callStatic(Class<?> cls, String method, Object... args); @SuppressWarnings("unchecked") static T callStatic(Class<?> cls, String method, Class<?>[] paramTypes,
      Object... args); static Field getField(Class<?> cls, String name); static Method getMethod(Class<?> cls, String name, Class<?>... parameterTypes); }
ReflectionUtil { public static <T> T newInstance(Class<T> cls) { return newInstance(cls, new Class[] {}, new Object[] {}); } private  ReflectionUtil(); static T newInstance(Class<T> cls); static T newInstance(Class<T> cls, Object... args); static T newInstance(Class<T> cls, Class<?>[] paramTypes, Object... args); static void set(Object obj, String field, Object value); static void setStatic(Class<?> cls, String field, Object value); @SuppressWarnings("unchecked") static T get(Object obj, String field); @SuppressWarnings("unchecked") static T getStatic(Class<?> cls, String field); @SuppressWarnings("unchecked") static T call(Object obj, String method); static T call(Object obj, String method, Object... args); @SuppressWarnings("unchecked") static T call(Object obj, String method, Class<?>[] paramTypes, Object... args); @SuppressWarnings("unchecked") static T callStatic(Class<?> cls, String method); static T callStatic(Class<?> cls, String method, Object... args); @SuppressWarnings("unchecked") static T callStatic(Class<?> cls, String method, Class<?>[] paramTypes,
      Object... args); static Field getField(Class<?> cls, String name); static Method getMethod(Class<?> cls, String name, Class<?>... parameterTypes);  }