예제 #1
0
 private void tstReflectionDelegation() throws ClassNotFoundException {
   Reflection test =
       new Reflection(
           new GenericReflector(
               null, new JdkReflector(Thread.currentThread().getContextClassLoader())));
   test.tstEverything();
 }
예제 #2
0
 public static Object toArrayGuessType(Collection<?> value) {
   Class<?> componentType = Reflection.getComponentType(value);
   Object array = Array.newInstance(componentType, value.size());
   @SuppressWarnings("unchecked")
   Iterator<Object> iterator = (Iterator<Object>) value.iterator();
   int index = 0;
   while (iterator.hasNext()) {
     BeanUtils.idx(array, index, iterator.next());
     index++;
   }
   return array;
 }