final Option option)
throws OptionException {
final List values = commandLine.getValues(option);
if (values.size() < minimum) {
throw new OptionException(option, ResourceConstants.ARGUMENT_MISSING_VALUES);
}
if (values.size() > maximum) {
throw new OptionException(option, ResourceConstants.ARGUMENT_UNEXPECTED_VALUE,
(String) values.get(maximum));
}
if (validator != null) {
try {
validator.validate(values);
} catch (InvalidArgumentException ive) {
throw new OptionException(option, ResourceConstants.ARGUMENT_UNEXPECTED_VALUE,
ive.getMessage());
}
}
}