//iterate through each item in the map (should contain a single ArrayList)
for (Iterator i = FVLookup.keySet().iterator(); i.hasNext();) {
ArrayList testList = (ArrayList) FVLookup.get(i.next());
//iterate through each item in the list
for (Object thisTest : testList) {
Validation validation = (Validation) thisTest;
// this is the matching validation for the given test
if (validation.getName().equals(test.getName())) {
//create a property descriptor containing the argument name and plugin class
PropertyDescriptor property = new PropertyDescriptor(arg.getName(), validation.getClass());
if (property == null) {
// error here
continue;
}
//store the value of the argument in the property descriptor
try {
property.getWriteMethod().invoke(validation,
new Object[] { arg.getValue() });
} catch (IllegalArgumentException e) {
String val = arg.getValue() == null? arg.getValue().toString():"null"; //$NON-NLS-1$
throw new ValidationException("test failed to configure " //$NON-NLS-1$
+ validation.getClass().getSimpleName() + " " + arg.getName()+ " "+val, e); //$NON-NLS-1$ //$NON-NLS-2$
} catch (IllegalAccessException e) {
String val = arg.getValue() == null? arg.getValue().toString():"null"; //$NON-NLS-1$
throw new ValidationException("test failed to configure " //$NON-NLS-1$
+ validation.getClass().getSimpleName() + " " + arg.getName()+ " "+val, e); //$NON-NLS-1$ //$NON-NLS-2$
} catch (InvocationTargetException e) {
String val = arg.getValue() == null? arg.getValue().toString():"null"; //$NON-NLS-1$
throw new ValidationException("test failed to configure " //$NON-NLS-1$
+ validation.getClass().getSimpleName() + " " + arg.getName()+ " "+val, e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
}
}