Search in sources :

Example 1 with SheetMapperBuilder

use of org.simpleflatmapper.poi.SheetMapperBuilder in project SimpleFlatMapper by arnaudroger.

the class DynamicSheetMapper method getPoiMapper.

private SheetMapper<T> getPoiMapper(MapperKey<CsvColumnKey> key) {
    SheetMapper<T> mapper = mapperCache.get(key);
    if (mapper == null) {
        final SheetMapperBuilder<T> builder = new SheetMapperBuilder<T>(classMeta, mapperConfig, getterFactory);
        for (CsvColumnKey k : key.getColumns()) {
            builder.addMapping(k, FieldMapperColumnDefinition.<CsvColumnKey>identity());
        }
        mapper = builder.mapper();
        mapperCache.add(key, mapper);
    }
    return mapper;
}
Also used : CsvColumnKey(org.simpleflatmapper.csv.CsvColumnKey) SheetMapperBuilder(org.simpleflatmapper.poi.SheetMapperBuilder)

Aggregations

CsvColumnKey (org.simpleflatmapper.csv.CsvColumnKey)1 SheetMapperBuilder (org.simpleflatmapper.poi.SheetMapperBuilder)1