use of net.robinfriedli.aiode.exceptions.InvalidArgumentException in project aiode by robinfriedli.
the class ArgumentBuildingMode method terminate.
@Override
public void terminate() {
try {
if (argumentBuilder.length() == 0) {
throw new InvalidArgumentException("Missing argument identifier");
}
ArgumentController argumentController = command.getArgumentController();
String argument = argumentBuilder.toString().trim();
String argumentValue = argumentValueBuilder.toString().trim();
argumentController.setArgument(argument, argumentValue);
commandParser.fireOnArgumentParsed(argument, argumentValue);
} catch (UserException e) {
throw new CommandParseException(e.getMessage(), command.getCommandBody(), e, conceptionIndex);
}
}
Aggregations