public final class Octopus extends Object
ExcelReader,
SheetReader,
ExcelWriter,
SheetWriter| Constructor and Description |
|---|
Octopus() |
| Modifier and Type | Method and Description |
|---|---|
static ConfigFactory |
getXMLConfigFactory(InputStream is)
Deprecated.
|
static <T> SheetReader<T> |
readBySheetName(InputStream is,
String sheetName,
Config config,
CellPosition startPosition)
read data from sheet by nodeName in excel
|
static <T> SheetReader<CheckedData<T>> |
readBySheetNameWithValidation(InputStream is,
String sheetName,
Config config,
CellPosition startPosition) |
static <T> SheetReader<T> |
readFirstSheet(InputStream is,
Config config,
CellPosition startPosition)
read data from first sheet of excel
|
static <T> SheetReader<CheckedData<T>> |
readFirstSheetWithValidation(InputStream is,
Config config,
CellPosition startPosition) |
static <T> SheetReader<T> |
readOneSheet(InputStream is,
int index,
Config config,
CellPosition startPosition)
read data from sheet at the specified position in excel
|
static <T> SheetReader<CheckedData<T>> |
readOneSheetWithValidation(InputStream is,
int index,
Config config,
CellPosition startPosition) |
static <T> void |
writeOneSheet(OutputStream os,
Config config,
String sheetName,
Collection<T> data)
write one sheet into excel file
|
@Deprecated public static ConfigFactory getXMLConfigFactory(InputStream is)
is - XML filepublic static <T> void writeOneSheet(OutputStream os, Config config, String sheetName, Collection<T> data) throws IOException
T - class type of data you wantos - excel fileconfig - get config through @{ConfigFactory}sheetName - nodeName of sheetdata - dataIOException - when writing excel file failedpublic static <T> SheetReader<T> readFirstSheet(InputStream is, Config config, CellPosition startPosition) throws IOException, org.apache.poi.openxml4j.exceptions.InvalidFormatException, org.apache.poi.EncryptedDocumentException
T - class type of data you wantis - excel fileconfig - get config through @{ConfigFactory}startPosition - where to start read,starting from 0IOException - if an error occurs while reading the dataorg.apache.poi.openxml4j.exceptions.InvalidFormatException - if the contents of the file cannot be parsed into a Workbookorg.apache.poi.EncryptedDocumentException - If the workbook given is password protectedDefaultCellPositionpublic static <T> SheetReader<T> readOneSheet(InputStream is, int index, Config config, CellPosition startPosition) throws IOException, org.apache.poi.openxml4j.exceptions.InvalidFormatException, org.apache.poi.EncryptedDocumentException
T - class type of data you wantis - excel fileindex - position,starting from 0config - get config through @{ConfigFactory}startPosition - where to start read,starting from 0IOException - if an error occurs while reading the dataorg.apache.poi.openxml4j.exceptions.InvalidFormatException - if the contents of the file cannot be parsed into a Workbookorg.apache.poi.EncryptedDocumentException - If the workbook given is password protectedpublic static <T> SheetReader<T> readBySheetName(InputStream is, String sheetName, Config config, CellPosition startPosition) throws IOException, org.apache.poi.openxml4j.exceptions.InvalidFormatException, org.apache.poi.EncryptedDocumentException, SheetNotFoundException
T - class type of data you wantis - excel filesheetName - nodeName of sheet in the excelconfig - get config through @{ConfigFactory}startPosition - where to start read,starting from 0IOException - if an error occurs while reading the dataorg.apache.poi.openxml4j.exceptions.InvalidFormatException - if the contents of the file cannot be parsed into a Workbookorg.apache.poi.EncryptedDocumentException - If the workbook given is password protectedSheetNotFoundException - when none of sheets'nodeName is sheetNamepublic static <T> SheetReader<CheckedData<T>> readFirstSheetWithValidation(InputStream is, Config config, CellPosition startPosition) throws IOException, org.apache.poi.openxml4j.exceptions.InvalidFormatException, org.apache.poi.EncryptedDocumentException
IOExceptionorg.apache.poi.openxml4j.exceptions.InvalidFormatExceptionorg.apache.poi.EncryptedDocumentExceptionpublic static <T> SheetReader<CheckedData<T>> readOneSheetWithValidation(InputStream is, int index, Config config, CellPosition startPosition) throws IOException, org.apache.poi.openxml4j.exceptions.InvalidFormatException, org.apache.poi.EncryptedDocumentException
IOExceptionorg.apache.poi.openxml4j.exceptions.InvalidFormatExceptionorg.apache.poi.EncryptedDocumentExceptionpublic static <T> SheetReader<CheckedData<T>> readBySheetNameWithValidation(InputStream is, String sheetName, Config config, CellPosition startPosition) throws IOException, org.apache.poi.openxml4j.exceptions.InvalidFormatException, org.apache.poi.EncryptedDocumentException, SheetNotFoundException
IOExceptionorg.apache.poi.openxml4j.exceptions.InvalidFormatExceptionorg.apache.poi.EncryptedDocumentExceptionSheetNotFoundExceptionCopyright © 2019. All rights reserved.