Java源码示例:com.beust.jcommander.converters.IParameterSplitter

示例1
/**
 * Use the splitter to split the value into multiple values and then convert
 * each of them individually.
 */
private Object convertToList(String value, IStringConverter<?> converter,
    Class<? extends IParameterSplitter> splitterClass)
        throws InstantiationException, IllegalAccessException {
  IParameterSplitter splitter = splitterClass.newInstance();
  List<Object> result = Lists.newArrayList();
  for (String param : splitter.split(value)) {
    result.add(converter.convert(param));
  }
  return result;
}