public class PbPOIExcelTemplate extends Object
| 构造器和说明 |
|---|
PbPOIExcelTemplate() |
| 限定符和类型 | 方法和说明 |
|---|---|
List<?> |
readFrom(File excelFile,
Class<?> returnClass)
Read excel file and write to list of T class
|
PbPOIExcelTemplate |
setTitleLine(int titleLine)
Set excel title line's number(start from 0).Default is 0.
|
Object |
valueOf(org.apache.poi.ss.usermodel.Cell cell)
return cell's value object
|
void |
writeTo(File excelFile,
List<?>... data)
Writes the specified data list to an Excel file.
|
void |
writeTo(FileSuffix fileSuffix,
OutputStream outputStream,
List<?>... data)
Writes the specified data list to an Excel file.
|
public List<?> readFrom(File excelFile, Class<?> returnClass) throws IOException, org.apache.poi.openxml4j.exceptions.InvalidFormatException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ParseException
excelFile - The file .xls or .xlsxreturnClass - the class type when returnIOException - io exceptionorg.apache.poi.openxml4j.exceptions.InvalidFormatException - invalid formatNoSuchMethodException - no such methodIllegalAccessException - illegal access exceptionInvocationTargetException - invocation target exceptionInstantiationException - instantiation errorParseException - parse errorpublic void writeTo(File excelFile, List<?>... data) throws IOException
excelFile - the excel filedata - the specified data list.Multiple sets of data to generate multiple sheets.IOException - io exceptionpublic void writeTo(FileSuffix fileSuffix, OutputStream outputStream, List<?>... data) throws IOException
fileSuffix - File's suffixoutputStream - Output streamdata - the specified data list.Multiple sets of data to generate multiple sheets.IOException - io exceptionpublic Object valueOf(org.apache.poi.ss.usermodel.Cell cell)
cell - Excelpublic PbPOIExcelTemplate setTitleLine(int titleLine)
titleLine - start calculate from not null rowCopyright © 2019. All rights reserved.