package com.izouma.wenlvju.utils.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;
import java.util.List;

public class UploadDataListener<T> extends AnalysisEventListener<T> {
    private final List<T> data;

    public UploadDataListener() {
        this.data = new ArrayList<>();
    }

    public List<T> getData() {
        return data;
    }

    @Override
    public void invoke(T t, AnalysisContext analysisContext) {
        data.add(t);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
