Properties
final Collection<PropertyDescriptor> descs;
descs = Arrays.asList(Introspector.getBeanInfo(object.getClass()).getPropertyDescriptors());
Is It a Getter?
final Boolean getter;
getter = (pd.getReadMethod() != null);
Is It Annotated?
final Boolean annotated;
annotated= pd.getReadMethod().getAnnotation(Column.class);
Invoking a Getter
This will return the property value:
final PropertyDescriptor pd;
final Object value;
pd = Iterables.getFirst(descs, null);
value = pd.getReadMethod().invoke(object);
Last updated
Was this helpful?