}
public PropertyDescriptor[] getPropertyDescriptors() {
if (propertyDescriptors == null) {
try {
BeanInfo bi = null;
if (clazz.isInterface()) {
bi = Introspector.getBeanInfo(clazz);
}
else {
bi = Introspector.getBeanInfo(clazz, Object.class);
}
PropertyDescriptor[] pds = bi.getPropertyDescriptors();
propertyDescriptors = new PropertyDescriptor[pds.length];
System.arraycopy(pds, 0, propertyDescriptors, 0, pds.length);
Arrays.sort(propertyDescriptors, new Comparator() {
public int compare(Object left, Object right) {
return ((PropertyDescriptor) left).getName().compareTo(