Class 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 Detail

      • SimpleWorkbookLoader

        public SimpleWorkbookLoader​(org.apache.poi.ss.usermodel.Workbook 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:
        getWorkbook in interface WorkbookLoader
        Returns:
        previously loaded workbook
        See Also:
        isCanUnload()
      • getSheetLoader

        public SheetLoader getSheetLoader​(int sheetIndex)
        Get the sheet accessor
        Specified by:
        getSheetLoader in interface WorkbookLoader
        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:
        getNumberOfSheets in interface WorkbookLoader
        Returns:
        the number of sheets in current workbook
      • setCanUnload

        public void setCanUnload​(boolean canUnload)
        Has no effect because this implementation never unload previously loaded Workbook
        Specified by:
        setCanUnload in interface WorkbookLoader
        Parameters:
        canUnload - the flag that this workbook can or cannot be unloaded
        See Also:
        WorkbookLoader.isCanUnload()