Given I have setup the following iterator (with domain being some class and input being some file):
BeanListProcessor<?> beanProcessor = new BeanListProcessor<Class<?>>((Class<Class<?>>) domain);
CsvParserSettings parserSettings = new CsvParserSettings();
parserSettings.setRowProcessor(beanProcessor);
parserSettings.setHeaderExtractionEnabled(true);
parserSettings.setDelimiterDetectionEnabled(true);
CsvRoutines routines = new CsvRoutines(parserSettings);
Iterator<?> it = routines.iterate(domain, input).iterator();
Why can't I use...
while (it.hasNext()) {
Object record = it.next();
it.remove();
}
...to remove a bean?
In other words what is the reason for this implementation in the class com.univocity.parsers.common.routine.AbstractRoutines?
@Override
public void remove() {
throw new UnsupportedOperationException("Can't remove beans");
}
I need to remove the "top" bean before iterating to the next bean.