private static List<ReflectionInfo> fromObject(Integer index, Object obj) throws IntrospectionException {
if (obj == null || obj.getClass().getName().startsWith("java.lang") // NOI18N
|| obj.getClass().getName().startsWith("java.math")) { // NOI18N
// Let the default handle this
return Collections.singletonList(new ReflectionInfo(index, null));
} else {
BeanInfo bi = Introspector.getBeanInfo(obj.getClass(), Object.class);
List<ReflectionInfo> result = new ArrayList<>();
for (PropertyDescriptor pd : bi.getPropertyDescriptors()) {
result.add(new ReflectionInfo(index, pd.getName()));
}
if (result.isEmpty()) {
return Collections.singletonList(new ReflectionInfo(index, null));
} else {
return result;
}
}
}
ReflectionInfo.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:incubator-netbeans
作者:
评论列表
文章目录