ClassUtil { public static void collectBeanInfo(Class<?> clazz, Map<String, PropertyDescriptor> name2descriptor) { Logger log = LoggerFactory.getLogger(ClassUtil.class); BeanInfo info = null; try { info = Introspector.getBeanInfo(clazz); } catch (Exception ex) { if (log.isDebugEnabled()) { log.debug("Cannot inspect class " + clazz, ex); } } if (info == null) { return; } for (PropertyDescriptor pd : info.getPropertyDescriptors()) { pd.setValue("type", pd.getPropertyType()); pd.setValue("resolvableAtDesignTime", Boolean.TRUE); name2descriptor.put(pd.getName(), pd); } } private  ClassUtil(); static Class<? extends T> getClass(String className,
            Class<T> baseClass); static Object instantiate(String className); static Object instantiate(String className, boolean returnNull); static void collectBeanInfo(Class<?> clazz,
            Map<String, PropertyDescriptor> name2descriptor);  }
@Test public void testCollectBeanInfo() { Map<String, PropertyDescriptor> name2descriptor = new HashMap<String, PropertyDescriptor>(); ClassUtil.collectBeanInfo(TestInterface.class, name2descriptor); assertEquals(MAP_SIZE, name2descriptor.size()); PropertyDescriptor descriptor = name2descriptor.get("value"); assertEquals("value", descriptor.getName()); assertEquals(int.class, descriptor.getPropertyType()); assertNotNull(descriptor.getReadMethod()); assertNotNull(descriptor.getWriteMethod()); descriptor = name2descriptor.get("value2"); assertEquals("value2", descriptor.getName()); assertEquals(long.class, descriptor.getPropertyType()); assertNotNull(descriptor.getReadMethod()); assertNull(descriptor.getWriteMethod()); descriptor = name2descriptor.get("value3"); assertEquals("value3", descriptor.getName()); assertEquals(String.class, descriptor.getPropertyType()); assertNull(descriptor.getReadMethod()); assertNotNull(descriptor.getWriteMethod()); }