return (Validator) validators.get(selected);
}
public String execute() throws Exception {
loadValidators();
Validator validator = getSelectedValidator();
properties = new TreeSet();
try {
Map context = reflectionContextFactory.createDefaultContext(validator);
BeanInfo beanInfoFrom = null;
try {
beanInfoFrom = Introspector.getBeanInfo(validator.getClass(), Object.class);
} catch (IntrospectionException e) {
LOG.error("An error occurred", e);
addActionError("An error occurred while introspecting a validator of type " + validator.getClass().getName());
return ERROR;
}
PropertyDescriptor[] pds = beanInfoFrom.getPropertyDescriptors();
for (int i = 0; i < pds.length; i++) {
PropertyDescriptor pd = pds[i];
String name = pd.getName();
Object value = null;
if (pd.getReadMethod() == null) {
value = "No read method for property";
} else {
try {
value = reflectionProvider.getValue(name, context, validator);
} catch (ReflectionException e) {
addActionError("Caught exception while getting property value for '" + name + "' on validator of type " + validator.getClass().getName());
}
}
properties.add(new PropertyInfo(name, pd.getPropertyType(), value));
}
} catch (Exception e) {