try {
value = convert(action, session, entry.getValue(), field.getGenericType());
} catch (Exception e) {
throw new CommandException(commandErrorSt +
Ansi.ansi().a("unable to convert option ").bold().a(entry.getKey().name()).boldOff().a(" with value '").a(entry.getValue()).a("' to type ")
.a(new GenericType(field.getGenericType()).toString()).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, session, entry.getValue(), field.getGenericType());
} catch (Exception e) {
throw new CommandException(commandErrorSt +
Ansi.ansi()
.a("unable to convert argument ").bold().a(entry.getKey().name()).boldOff().a(" with value '").a(entry.getValue())
.a("' to type ").a(new GenericType(field.getGenericType()).toString()).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);