public Map<String, BeanProperty> getProperties() {
try {
ImmutableMap.Builder<String, BeanProperty> properties = ImmutableMap.builder();
BeanInfo beanInfo = Introspector.getBeanInfo(getRawType(), Object.class);
for (PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) {
MethodDescriptor readMethod = getMethodDescriptor(propertyDescriptor.getReadMethod());
MethodDescriptor writeMethod = getMethodDescriptor(propertyDescriptor.getWriteMethod());
if (readMethod != null || writeMethod != null) {
BeanProperty property = new BeanProperty(propertyDescriptor.getName(), readMethod, writeMethod);
properties.put(property.getName(), property);
}
}
return properties.build();
} catch (Exception e) {
throw new ReflectionException(toString(), e);
}
}