com.github.bingoohuang.excel2maps.ExcelSheetToMaps Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of excel2javabeans Show documentation
Show all versions of excel2javabeans Show documentation
a little utility to convert excel rows to java beans
package com.github.bingoohuang.excel2maps;
import com.github.bingoohuang.excel2maps.impl.ColumnRef;
import com.github.bingoohuang.excel2maps.impl.Ignored;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;
import java.util.List;
import java.util.Map;
import static org.apache.commons.lang3.StringUtils.isEmpty;
import static org.apache.commons.lang3.StringUtils.trim;
public class ExcelSheetToMaps {
private final Workbook workbook;
private final ExcelToMapsConfig excelToMapsConfig;
private final List columnRefs;
private final DataFormatter cellFormatter = new DataFormatter();
public ExcelSheetToMaps(Workbook workbook, ExcelToMapsConfig excelToMapsConfig) {
this.workbook = workbook;
this.excelToMapsConfig = excelToMapsConfig;
this.columnRefs = Lists.newArrayList();
}
public List