1 2 3 4 5 6 7 |
for (PropertyDescriptor pd : Introspector.getBeanInfo(someObject.getClass()).getPropertyDescriptors()) { if (!"class".equals(pd.getName())) { Class<?> type = pd.getPropertyType(); Method getter = pd.getReadMethod(); // might be null! Method setter = pd.getWriteMethod(); // might be null! } } |
zusammengestoppelt auf stackoverflow