public class CSVWorksheetWriter extends Object implements IWorksheetWriter
| 限定符和类型 | 字段和说明 |
|---|---|
protected Charset |
charset |
protected char |
delimiter
Delimiter char
|
protected BiConsumer<Sheet,Integer> |
progressConsumer
A progress window
|
protected boolean |
ready |
protected Sheet |
sheet |
protected boolean |
withBom |
protected Path |
workSheetPath
临时路径
|
protected CSVUtil.Writer |
writer |
| 构造器和说明 |
|---|
CSVWorksheetWriter() |
CSVWorksheetWriter(Sheet sheet) |
CSVWorksheetWriter(Sheet sheet,
boolean withBom) |
| 限定符和类型 | 方法和说明 |
|---|---|
IWorksheetWriter |
clone()
复制工作表输出协议
|
void |
close() |
ICellValueAndStyle |
getCellValueAndStyle()
返回CSV数据样式转换器,该转换器将所有数据转为字符器格式并忽略所有样式
|
int |
getColumnLimit()
The column limit
|
String |
getFileSuffix()
Returns the worksheet name
|
int |
getRowLimit()
The row limit
|
protected Path |
initWriter(Path root) |
CSVWorksheetWriter |
setCharset(Charset charset)
设置字符集
|
CSVWorksheetWriter |
setDelimiter(char delimiter)
Settings delimiter char
|
IWorksheetWriter |
setWorksheet(Sheet sheet)
设置工作表
|
protected void |
writeBefore()
Write worksheet header data
|
void |
writeData(RowBlock rowBlock)
PUSH模式推行数据
|
protected void |
writeRow(Row row)
Write a row data
|
protected void |
writeRowBlock(RowBlock rowBlock)
Write a row-block
|
protected void |
writeRowBlockFireProgress(RowBlock rowBlock)
Write a row-block and fire progress event
|
void |
writeTo(Path root)
写入指定路径,传入的参数可以是一个文件也可以是文件夹,需要在实现类具体处理
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisBigDecimal, isBool, isChar, isDate, isDateTime, isDouble, isFloat, isInt, isLocalDate, isLocalDateTime, isLocalTime, isLong, isShort, isString, isTime, writePicture, writeToprotected Sheet sheet
protected CSVUtil.Writer writer
protected BiConsumer<Sheet,Integer> progressConsumer
protected boolean withBom
protected boolean ready
protected Charset charset
protected char delimiter
protected Path workSheetPath
public CSVWorksheetWriter()
public CSVWorksheetWriter(Sheet sheet)
public CSVWorksheetWriter(Sheet sheet, boolean withBom)
public int getRowLimit()
getRowLimit 在接口中 IWorksheetWriter(1 << 31) - 1public int getColumnLimit()
getColumnLimit 在接口中 IWorksheetWriterpublic CSVWorksheetWriter setDelimiter(char delimiter)
delimiter - delimiter charpublic IWorksheetWriter setWorksheet(Sheet sheet)
IWorksheetWritersetWorksheet 在接口中 IWorksheetWritersheet - 工作表Sheetpublic IWorksheetWriter clone()
IWorksheetWriterclone 在接口中 IWorksheetWriterclone 在类中 Objectpublic String getFileSuffix()
getFileSuffix 在接口中 IWorksheetWriterpublic void writeData(RowBlock rowBlock) throws IOException
IWorksheetWriterwriteData 在接口中 IWorksheetWriterrowBlock - 行块IOException - if I/O error occurpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionpublic void writeTo(Path root) throws IOException
StorablewriteTo 在接口中 Storableroot - 父级文件夹或文件绝对路径IOException - 写失败异常protected Path initWriter(Path root) throws IOException
IOExceptionprotected void writeBefore()
throws IOException
IOException - if I/O error occurprotected void writeRowBlock(RowBlock rowBlock) throws IOException
rowBlock - the row-blockIOException - if I/O error occur.protected void writeRowBlockFireProgress(RowBlock rowBlock) throws IOException
rowBlock - the row-blockIOException - if I/O error occur.protected void writeRow(Row row) throws IOException
row - a row dataIOException - if I/O error occurpublic CSVWorksheetWriter setCharset(Charset charset)
charset - Charsetpublic ICellValueAndStyle getCellValueAndStyle()
getCellValueAndStyle 在接口中 IWorksheetWriterICellValueAndStyleCopyright © 2025. All rights reserved.