package com.zcxk.rmcp.web.excel.resolver.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.zcxk.rmcp.web.excel.model.CommImportData;
import org.apache.commons.lang3.StringUtils;

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

/**
 * @author linqingwei
 * @date 2021-07-23 11:21
 */
public class CommDataListener extends AnalysisEventListener<CommImportData> {
    private List<CommImportData> list = new ArrayList<>();
    @Override
    public void invoke(CommImportData data, AnalysisContext analysisContext) {
        if (data != null && StringUtils.isNotEmpty(data.getName())) {
            list.add(data);
        }
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

    public List<CommImportData> getData(){
        return list;
    }
}
