Search in sources :

Example 16 with CsvColumnKey

use of org.simpleflatmapper.csv.CsvColumnKey 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)16 Test (org.junit.Test)10 DateFormatProperty (org.simpleflatmapper.map.property.DateFormatProperty)4 Type (java.lang.reflect.Type)3 ParsingContext (org.simpleflatmapper.csv.ParsingContext)3 StringReader (java.io.StringReader)2 CellValueReader (org.simpleflatmapper.csv.CellValueReader)2 CellValueReaderFactory (org.simpleflatmapper.csv.CellValueReaderFactory)2 CsvColumnDefinition (org.simpleflatmapper.csv.CsvColumnDefinition)2 ParsingContextFactoryBuilder (org.simpleflatmapper.csv.ParsingContextFactoryBuilder)2 EnumOrdinalFormatProperty (org.simpleflatmapper.map.property.EnumOrdinalFormatProperty)2 FieldMapperColumnDefinition (org.simpleflatmapper.map.property.FieldMapperColumnDefinition)2 BooleanGetter (org.simpleflatmapper.reflect.primitive.BooleanGetter)2 ByteGetter (org.simpleflatmapper.reflect.primitive.ByteGetter)2 CharacterGetter (org.simpleflatmapper.reflect.primitive.CharacterGetter)2 DoubleGetter (org.simpleflatmapper.reflect.primitive.DoubleGetter)2 FloatGetter (org.simpleflatmapper.reflect.primitive.FloatGetter)2 IntGetter (org.simpleflatmapper.reflect.primitive.IntGetter)2 LongGetter (org.simpleflatmapper.reflect.primitive.LongGetter)2 ShortGetter (org.simpleflatmapper.reflect.primitive.ShortGetter)2