All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.creekmoon.excelUtils.core.SheetReaderContext Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
package cn.creekmoon.excelUtils.core;

import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Supplier;

public class SheetReaderContext {
    /**
     * 标题行号 这里是0,意味着第一行是标题
     */
    public int titleRowIndex = 0;

    /**
     * 首行数据行号
     */
    public int firstRowIndex = titleRowIndex + 1;

    /**
     * 末行数据行号
     */
    public int latestRowIndex = Integer.MAX_VALUE;

    public int sheetIndex;
    public Supplier newObjectSupplier;

    /* key=rowIndex  value= 单元格消费者*/
    protected LinkedHashMap>> singleCellConsumers = new LinkedHashMap(32);

    /* key=title  value=执行器 */
    protected LinkedHashMap title2converts = new LinkedHashMap(32);
    /* key=title value=消费者(通常是setter方法)*/
    protected LinkedHashMap title2consumers = new LinkedHashMap(32);
    protected List convertPostProcessors = new ArrayList<>();
    /* key=title */
    protected Set mustExistTitles = new HashSet<>(32);
    protected Set skipEmptyTitles = new HashSet<>(32);
    /*启用空白行过滤*/
    protected boolean ENABLE_BLANK_ROW_FILTER = true;
    /*启用EXCEL标题模板一致性检查 为了防止模板导入错误*/
    protected boolean ENABLE_TITLE_CHECK = true;
    /*标志位,如果标题检查失败, 这个会置为true */
    protected boolean TITLE_CHECK_FAIL_FLAG = false;

    public SheetReaderContext(int sheetIndex, Supplier newObjectSupplier) {
        this.sheetIndex = sheetIndex;
        this.newObjectSupplier = newObjectSupplier;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy