Package org.openl.rules.lang.xls.load
Class SimpleWorkbookLoader
- java.lang.Object
-
- org.openl.rules.lang.xls.load.SimpleWorkbookLoader
-
- All Implemented Interfaces:
WorkbookLoader
public class SimpleWorkbookLoader extends Object implements WorkbookLoader
Stores the strong reference to previously loaded Workbook instance and is not unloaded.
-
-
Constructor Summary
Constructors Constructor Description SimpleWorkbookLoader(org.apache.poi.ss.usermodel.Workbook workbook)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetNumberOfSheets()Get number of sheets in current workbook.SheetLoadergetSheetLoader(int sheetIndex)Get the sheet accessorSpreadsheetConstantsgetSpreadsheetConstants()org.apache.poi.ss.usermodel.WorkbookgetWorkbook()Get the workbook.booleanisCanUnload()Always returns falsevoidsetCanUnload(boolean canUnload)Has no effect because this implementation never unload previously loaded Workbook
-
-
-
Method Detail
-
getWorkbook
public org.apache.poi.ss.usermodel.Workbook getWorkbook()
Get the workbook. When this method is repeatedly called, always returns the same instance of workbook java object.- Specified by:
getWorkbookin interfaceWorkbookLoader- Returns:
- previously loaded workbook
- See Also:
isCanUnload()
-
getSheetLoader
public SheetLoader getSheetLoader(int sheetIndex)
Get the sheet accessor- Specified by:
getSheetLoaderin interfaceWorkbookLoader- Parameters:
sheetIndex- the sheet index in the workbook- Returns:
- object that provides access to the specified sheet of current workbook
-
getNumberOfSheets
public int getNumberOfSheets()
Get number of sheets in current workbook.- Specified by:
getNumberOfSheetsin interfaceWorkbookLoader- Returns:
- the number of sheets in current workbook
-
isCanUnload
public boolean isCanUnload()
Always returns false- Specified by:
isCanUnloadin interfaceWorkbookLoader- Returns:
- false
- See Also:
WorkbookLoader.setCanUnload(boolean)
-
setCanUnload
public void setCanUnload(boolean canUnload)
Has no effect because this implementation never unload previously loaded Workbook- Specified by:
setCanUnloadin interfaceWorkbookLoader- Parameters:
canUnload- the flag that this workbook can or cannot be unloaded- See Also:
WorkbookLoader.isCanUnload()
-
getSpreadsheetConstants
public SpreadsheetConstants getSpreadsheetConstants()
- Specified by:
getSpreadsheetConstantsin interfaceWorkbookLoader
-
-