Class XlsxBufferedReader

java.lang.Object
overit.geocall.util.XlsxBufferedReader

public class XlsxBufferedReader extends Object
This class is an utility implementation that must be used if you want to read the contents of a XLSX from an InputStream
  • Field Details

    • _workbook

      protected org.apache.poi.xssf.usermodel.XSSFWorkbook _workbook
    • _sheet

      protected org.apache.poi.xssf.usermodel.XSSFSheet _sheet
    • _columns

      protected int _columns
    • _rows

      protected int _rows
    • _currLine

      protected int _currLine
    • HEADERS

      public static final int HEADERS
      See Also:
    • NOHEADERS

      public static final int NOHEADERS
      See Also:
    • SKIPHEADERS

      public static final int SKIPHEADERS
      See Also:
    • MAXROWS

      public static final int MAXROWS
    • MAXCOLS

      public static final int MAXCOLS
    • TYPE_STRING

      public static final int TYPE_STRING
      See Also:
    • TYPE_DATE

      public static final int TYPE_DATE
      See Also:
    • TYPE_INTEGER

      public static final int TYPE_INTEGER
      See Also:
    • TYPE_FLOAT

      public static final int TYPE_FLOAT
      See Also:
  • Constructor Details

  • Method Details

    • changeSheet

      public void changeSheet(String sheetName)
      Changes the sheet
      Parameters:
      sheetName - The name of the sheet to change
    • close

      public void close() throws IOException
      Closes the XSSFWorkbook
      Throws:
      IOException - if an I/O error occurs
    • readCsvLine

      public ArrayList readCsvLine()
      Reads the CVS line
      Returns:
      An ArrayList containing the CVS line
    • readCsvLine

      public ArrayList readCsvLine(XlsxBufferedReader.ExceptionHandler handler)
      Reads the CVS line
      Parameters:
      handler - The XlsxBufferedReader.ExceptionHandler
      Returns:
      An ArrayList containing the CVS line
    • toDBView

      public DBView toDBView(int[] types, String[] formats, int headers, PrintStream ps) throws DAValidateException
      Returns the DBView representation of the Xlsx
      Parameters:
      types - The array of types, the lenght and the number of columns must be equals
      formats - The array of formats
      headers - The headers
      ps - The PrintStream
      Returns:
      The DBView representation of the Xlsx
      Throws:
      DAValidateException - if the number of columns is not compatible, or the number of rows or columns excede the max number
    • main

      public static final void main(String[] args) throws Exception
      Throws:
      Exception