com.gaoice.easyexcel.SheetInfo Maven / Gradle / Ivy
package com.gaoice.easyexcel;
import com.gaoice.easyexcel.data.Converter;
import com.gaoice.easyexcel.data.Counter;
import com.gaoice.easyexcel.style.SheetStyle;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SheetInfo {
private String sheetName;
private String title;
/**
* 列名
*/
private String[] columnNames;
/**
* 列名对应的类字段名
*/
private String[] classFieldNames;
private List list;
private SheetStyle sheetStyle;
private Map converterMap;
private Map counterMap;
/**
* SheetInfo 被使用后,fieldCache 会缓存,相同的 classFieldNames 可以重复使用 SheetInfo 以提高效率
*/
private List> fieldCache;
public SheetInfo(String sheetName, String[] columnNames, String[] classFieldNames, List list) {
this.sheetName = sheetName;
this.columnNames = columnNames;
this.classFieldNames = classFieldNames;
this.list = list;
}
public SheetInfo(String sheetName, String title, String[] columnNames, String[] classFieldNames, List list) {
this.sheetName = sheetName;
this.title = title;
this.columnNames = columnNames;
this.classFieldNames = classFieldNames;
this.list = list;
}
/**
* 为 classFieldName列 设置单元格转换器,Map键值对
*
* @param classFieldName 字段名
* @param dictionary 数据字典
*/
public SheetInfo putConverter(String classFieldName, Map