Package org.openl.excel.parser.dom
Class DOMReader
- java.lang.Object
-
- org.openl.excel.parser.dom.DOMReader
-
- All Implemented Interfaces:
AutoCloseable,ExcelReader
public class DOMReader extends Object implements ExcelReader
-
-
Constructor Summary
Constructors Constructor Description DOMReader(InputStream is)DOMReader(String fileName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close ExcelReader and release resources.Object[][]getCells(SheetDescriptor sheet)Parse and get all cells from a given sheetList<? extends SheetDescriptor>getSheets()Get all sheet descriptorsTableStylesgetTableStyles(SheetDescriptor sheet, IGridRegion tableRegion)Get styles for a given tablebooleanisUse1904Windowing()Sometimes we need to convert parsed double value to date.
-
-
-
Constructor Detail
-
DOMReader
public DOMReader(String fileName)
-
DOMReader
public DOMReader(InputStream is)
-
-
Method Detail
-
getSheets
public List<? extends SheetDescriptor> getSheets()
Description copied from interface:ExcelReaderGet all sheet descriptors- Specified by:
getSheetsin interfaceExcelReader
-
getCells
public Object[][] getCells(SheetDescriptor sheet)
Description copied from interface:ExcelReaderParse and get all cells from a given sheet- Specified by:
getCellsin interfaceExcelReader- Parameters:
sheet- sheet to parse- Returns:
- parsed objects with types as in Excel
-
isUse1904Windowing
public boolean isUse1904Windowing()
Description copied from interface:ExcelReaderSometimes we need to convert parsed double value to date. For example a cell contains value 1.25, user sees it in Excel as 1.25 but in OpenL this value has a type Date. It should be converted from double to Date. (There is unit test for such case) We should get this property from workbook and use it in DateUtil.getJavaDate(double, boolean) to convert it correctly.- Specified by:
isUse1904Windowingin interfaceExcelReader- Returns:
- The setting for a given workbook
-
getTableStyles
public TableStyles getTableStyles(SheetDescriptor sheet, IGridRegion tableRegion)
Description copied from interface:ExcelReaderGet styles for a given table- Specified by:
getTableStylesin interfaceExcelReader- Parameters:
sheet- sheet containing the tabletableRegion- region needed to get styles for a given table- Returns:
- Cell styles
-
close
public void close()
Description copied from interface:ExcelReaderClose ExcelReader and release resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceExcelReader
-
-