try {
for (String fieldName : template.getFields().keySet()) {
try {
value = values.getField(fieldName);
} catch (final IllegalArgumentException e) {
throw new StatusUpdateInstantiationFailedException(
e.getMessage());
}
templateInstantiationClass.getField(fieldName).set(
statusUpdate, value);
}
// set status update file paths
for (String fileName : template.getFiles().keySet()) {
try {
value = values.getFile(fileName).getAbsoluteFilePath();
} catch (final IllegalArgumentException e) {
throw new StatusUpdateInstantiationFailedException(
e.getMessage());
}
templateInstantiationClass.getField(fileName).set(
statusUpdate, value);
}
} catch (final IllegalArgumentException e) {
throw new StatusUpdateInstantiationFailedException(
"The types of the parameters passed do not match the status update template.");
}
return statusUpdate;
} catch (final SecurityException e) {