com.github.skjolber.dc.gtfs.mt.StaticCsvMapperAdapter Maven / Gradle / Ivy
package com.github.skjolber.dc.gtfs.mt;
import java.io.Reader;
import com.github.skjolber.stcsv.CsvReader;
import com.github.skjolber.stcsv.databinder.StaticCsvMapper;
import com.github.skjolber.stcsv.databinder.StaticCsvMapper2;
public abstract class StaticCsvMapperAdapter implements StaticCsvMapper {
protected StaticCsvMapper2 staticCsvMapper2;
public StaticCsvMapperAdapter(StaticCsvMapper2 staticCsvMapper2) {
this.staticCsvMapper2 = staticCsvMapper2;
}
@Override
public CsvReader newInstance(Reader reader) {
return staticCsvMapper2.newInstance(reader, newIntermediateProcessor());
}
@Override
public CsvReader newInstance(Reader reader, char[] current, int offset, int length) {
return staticCsvMapper2.newInstance(reader, current, offset, length, newIntermediateProcessor());
}
protected abstract D newIntermediateProcessor();
}