Class XLSBufferedReader

java.lang.Object
overit.geocall.util.XLSBufferedReader

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

    • CONVERT_FORMATS

      protected static final HashMap<String,SimpleDateFormat> CONVERT_FORMATS
    • _workbook

      protected org.apache.poi.hssf.usermodel.HSSFWorkbook _workbook
    • _sheet

      protected org.apache.poi.hssf.usermodel.HSSFSheet _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 HSSFWorkbook
      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(XLSBufferedReader.ExceptionHandler handler)
      Reads the CVS line
      Parameters:
      handler - The XLSBufferedReader.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 XLS
      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 XLS
      Throws:
      DAValidateException - if the number of columns is not compatible, or the number of rows or columns excede the max number