try {
value = convert(action, entry.getValue(), field.getGenericType());
} catch (Exception e) {
throw new CommandException(commandErrorSt +
"unable to convert option " + INTENSITY_BOLD + entry.getKey().name() + INTENSITY_NORMAL + " with value '"
+ entry.getValue() + "' to type " + new GenericType(field.getGenericType()).toString(),
"Unable to convert option " + entry.getKey().name() + " with value '"
+ entry.getValue() + "' to type " + new GenericType(field.getGenericType()).toString(),
e
);
}
field.setAccessible(true);
field.set(action, value);
}
for (Map.Entry<Argument, Object> entry : argumentValues.entrySet()) {
Field field = arguments.get(entry.getKey());
Object value;
try {
value = convert(action, entry.getValue(), field.getGenericType());
} catch (Exception e) {
throw new CommandException(commandErrorSt +
"unable to convert argument " + INTENSITY_BOLD + entry.getKey().name() + INTENSITY_NORMAL + " with value '"
+ entry.getValue() + "' to type " + new GenericType(field.getGenericType()).toString(),
"Unable to convert argument " + entry.getKey().name() + " with value '"
+ entry.getValue() + "' to type " + new GenericType(field.getGenericType()).toString(),
e
);
}
field.setAccessible(true);
field.set(action, value);