I’m searching for something that works like BeanUtils.describe, but working on .class, not object ? Anybody help ? Currently i’m working on list of objects class with default getHeaders method like below.
public class SimpleList<E> {
protected final Class<E> clazz;
SimpleList(Class<E> clazz) {
this.clazz = clazz;
}
public String[] getHeaders() {
Map props = BeanUtils.describe(clazz); // replace this with something
return (String[]) props.keySet().toArray();
}
}
Use the
IntrospectorAPI: