Interface IWorkbookReader
To instanciate an implementation of the IWorkbookreader interface use the
WorkbookHandlerFactory.createWorkbookReader method.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Get if the the header row should be identified automatically.int
Returns the type of the currently read xls document.Get the index of the column where the data reading should finish.Get the index of the row where the data reading should finish.Gets the absolute index of the header row.boolean
Defines if only the structures should be read from the workbook or the properties as well.Returns the list of Worksheet names from the Xls WorkbookGet the index of the column from where the data reading should start.Get the index of the row from where the data reading should start.Get the XSSFWorkBook as objectboolean
Determines if the document has ever contained JCXL structures.Gets all the structures from the given sheet based on the range given in FirstRowIndex, LastRowIndex, FirstColumnIndex, LastColumnIndex.Gets all the structures from the active sheet based on the range given in FirstRowIndex, LastRowIndex, FirstColumnIndex, LastColumnIndex.Gets all the structures from the workbook based on the range given in FirstRowIndex, LastRowIndex, FirstColumnIndex, LastColumnIndex.void
setDetectHeader
(boolean detectHeader) Set if the the header row should be identified automatically.void
setEndColumnIndex
(Integer index) Set the index of the column where the data reading should finish.void
setEndRowIndex
(Integer index) Set the index of the row where the data reading should finish.void
setHeaderRowIndex
(Integer headerRowIndex) Sets the absolute index of the header row.void
setIsReadStructuresOnly
(boolean readStructuresOnly) Defines if only the structures should be read from the workbook or the properties as well.void
setStartColumnIndex
(Integer index) Set the index of the column from where the data reading should start.void
setStartRowIndex
(Integer index) Set the index of the row from where the data reading should start.
-
Method Details
-
getWorkBook
Object getWorkBook()Get the XSSFWorkBook as object- Returns:
- XSSFWorkBook
-
getDocumentType
int getDocumentType()Returns the type of the currently read xls document. Available values are: Unknown(0), JChemForXls(2), ChemDraw(4), ISISiSentris(6), AccelrysDraw(8)- Returns:
- DocumentType
-
getSheetNames
Returns the list of Worksheet names from the Xls Workbook- Returns:
- List of Sheet Names
-
getStartRowIndex
Integer getStartRowIndex()Get the index of the row from where the data reading should start. In case of null value, or invalid value (i.e. -1) the reading will start at the first row of the document.- Returns:
- the start row index (indexing start from 0). Default is null.
-
setStartRowIndex
Set the index of the row from where the data reading should start. In case of null value, or invalid value (i.e. -1) the reading will start at the first row of the document.- Parameters:
index
- : the start row index (indexing start from 0). Default is null.
-
getEndRowIndex
Integer getEndRowIndex()Get the index of the row where the data reading should finish. In case of null value, or invalid value (i.e. -1) the reading will end at the last row of the document.- Returns:
- the end row index (indexing start from 0). Default is null.
-
setEndRowIndex
Set the index of the row where the data reading should finish. In case of null value, or invalid value (i.e. -1) the reading will end at the last row of the document.- Parameters:
index
- : the end row index (indexing start from 0). Default is null.
-
getStartColumnIndex
Integer getStartColumnIndex()Get the index of the column from where the data reading should start. In case of null value, or invalid value (i.e. -1) the reading will start at the first column of the document.- Returns:
- the start column index (indexing start from 0). Default is null.
-
setStartColumnIndex
Set the index of the column from where the data reading should start. In case of null value, or invalid value (i.e. -1) the reading will start at the first column of the document.- Parameters:
index
- : the start column index (indexing start from 0). Default is null.
-
getEndColumnIndex
Integer getEndColumnIndex()Get the index of the column where the data reading should finish. In case of null value, or invalid value (i.e. -1) the reading will end at the last column of the document.- Returns:
- the end column index (indexing start from 0). Default is null.
-
setEndColumnIndex
Set the index of the column where the data reading should finish. In case of null value, or invalid value (i.e. -1) the reading will end at the last column of the document.- Parameters:
index
- : the end column index (indexing start from 0). Default is null.
-
getDetectHeader
boolean getDetectHeader()Get if the the header row should be identified automatically. If detectHeader is set to true the headerRow index will be set to null automatically. Default value is false. The automatic detecting means that we find the row above the first structure row and read the column names from this found row. But this found row must be in the given start row - end row range.- Returns:
- true if the header should be identified automatically, false otherwise. Default is false.
-
setDetectHeader
void setDetectHeader(boolean detectHeader) Set if the the header row should be identified automatically. If detectHeader is set to true the headerRow index will be set to null. The automatic detecting means that we find the row above the first structure row and read the column names from this found row. But this found row must be in the given start row - end row range.- Parameters:
detectHeader
- : true if the header should be identified automatically, false otherwise. Default is false.
-
getHeaderRowIndex
Integer getHeaderRowIndex()Gets the absolute index of the header row. The index is 0 based. If headerRow is set the detectHeader option will not be used. If the value is null it means the header row is not set.- Returns:
- 0 based index of the header row. Default is null.
-
setHeaderRowIndex
Sets the absolute index of the header row. The index is 0 based. If headerRow is set the detectHeader option will not be used. If the value is null it means the header row is not set.- Parameters:
headerRowIndex
- : 0 based index of the header row. Default is null.
-
getIsReadStructuresOnly
boolean getIsReadStructuresOnly()Defines if only the structures should be read from the workbook or the properties as well.- Returns:
- true if only the structures should be read from the workbook otherwise false. Default false.
-
setIsReadStructuresOnly
void setIsReadStructuresOnly(boolean readStructuresOnly) Defines if only the structures should be read from the workbook or the properties as well.- Parameters:
readStructuresOnly
- : true if only the structures should be read from the workbook otherwise false. Default false.
-
readActiveSheet
Gets all the structures from the active sheet based on the range given in FirstRowIndex, LastRowIndex, FirstColumnIndex, LastColumnIndex.- Returns:
- the list of the structure maps, which contains the location and structure data
- Throws:
Exception
-
read
Gets all the structures from the given sheet based on the range given in FirstRowIndex, LastRowIndex, FirstColumnIndex, LastColumnIndex.- Returns:
- the list of the structure maps, which contains the location and structure data
- Throws:
Exception
-
readAllSheets
Gets all the structures from the workbook based on the range given in FirstRowIndex, LastRowIndex, FirstColumnIndex, LastColumnIndex.- Returns:
- the list of the structure maps, which contains the location and structure data
- Throws:
Exception
-
isDocumentJCXL
boolean isDocumentJCXL()Determines if the document has ever contained JCXL structures.- Returns:
- True if the document is JCXL.
-