|
|
@ -4,9 +4,11 @@ import com.alibaba.excel.read.metadata.ReadWorkbook; |
|
|
|
import com.alibaba.excel.read.metadata.holder.ReadWorkbookHolder; |
|
|
|
import com.alibaba.excel.read.metadata.holder.ReadWorkbookHolder; |
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum; |
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.excel.util.StringUtils; |
|
|
|
import lombok.EqualsAndHashCode; |
|
|
|
import lombok.EqualsAndHashCode; |
|
|
|
import lombok.Getter; |
|
|
|
import lombok.Getter; |
|
|
|
import lombok.Setter; |
|
|
|
import lombok.Setter; |
|
|
|
|
|
|
|
import org.apache.commons.compress.utils.CharsetNames; |
|
|
|
import org.apache.commons.csv.CSVFormat; |
|
|
|
import org.apache.commons.csv.CSVFormat; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -21,9 +23,12 @@ public class CsvReadWorkbookHolder extends ReadWorkbookHolder { |
|
|
|
|
|
|
|
|
|
|
|
private CSVFormat csvFormat; |
|
|
|
private CSVFormat csvFormat; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String encoding; |
|
|
|
|
|
|
|
|
|
|
|
public CsvReadWorkbookHolder(ReadWorkbook readWorkbook) { |
|
|
|
public CsvReadWorkbookHolder(ReadWorkbook readWorkbook) { |
|
|
|
super(readWorkbook); |
|
|
|
super(readWorkbook); |
|
|
|
setExcelType(ExcelTypeEnum.CSV); |
|
|
|
setExcelType(ExcelTypeEnum.CSV); |
|
|
|
this.csvFormat = CSVFormat.DEFAULT; |
|
|
|
this.csvFormat = CSVFormat.DEFAULT; |
|
|
|
|
|
|
|
this.encoding = StringUtils.isEmpty(readWorkbook.getEncoding())? CharsetNames.UTF_8:readWorkbook.getEncoding(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|