Interface ExportDriver


  • public interface ExportDriver
    Interface implemented by classes that can be used to export data.

    This is a low level API that should be used like this:

     beginExport(file);
     foreach (sheet):
        beginSheet(sheet.template);
        foreach (row):
           beginRow();
           foreach(column):
              setData(column, data);
           endRow();
        endSheet();
     endExport();
     
    Author:
    Damien Carbonne
    • Method Detail

      • beginExport

        void beginExport​(File file)
                  throws IOException
        Must be invoked at beginning of export.
        Parameters:
        file - The target file.
        Throws:
        IOException - When a IO error occurs.
      • beginSheet

        void beginSheet​(SheetTemplate template,
                        String sheetName,
                        long numberOfRows)
                 throws IOException
        Must be invoked at the beginning of a sheet export.

        Using several times the same template in a workbook must be supported.

        Parameters:
        template - The template used for that sheet.
        sheetName - The sheet name.
        numberOfRows - The number of rows to export in this sheet, or -1L if unknown.
        Throws:
        IOException - When a IO error occurs.
      • endSheet

        void endSheet()
               throws IOException
        Must be invoked at the end of writing a sheet.
        Throws:
        IOException - When a IO error occurs.
      • endExport

        void endExport()
                throws IOException
        Must be invoked at end of export.
        Throws:
        IOException - When a IO error occurs.