Class FlatFileParser.ExcelData

java.lang.Object
net.sf.basedb.util.parser.FlatFileParser.Data
net.sf.basedb.util.parser.FlatFileParser.ExcelData
Enclosing class:
FlatFileParser

static class FlatFileParser.ExcelData extends FlatFileParser.Data
Subclass that is used to return data when the source file is an Excel file. It will forward all get() methods to retrieve the data directly from the Cell item in Excel.
  • Field Details

    • sheet

      private final XlsxToCsvUtil.SheetInfo sheet
    • rowOffset

      private final int rowOffset
    • colOffset

      private final int colOffset
  • Constructor Details

    • ExcelData

      ExcelData(XlsxToCsvUtil.SheetInfo sheet, int lineOffset, int lineNo, int dataLineNo, String line, String[] columns, boolean emptyIsNull, boolean nullIsNull, boolean trimWhiteSpace)
      Create a new data object.
  • Method Details

    • getString

      public String getString(int index)
      Description copied from class: FlatFileParser.Data
      Get the value in the specified column.
      Overrides:
      getString in class FlatFileParser.Data
      Parameters:
      index - The index for the column, starting at 0
      Returns:
      The value in the column
    • getInt

      public Integer getInt(int index, NumberFormat parser, boolean nullIfException)
      Description copied from class: FlatFileParser.Data
      Get the value as an integer. The default implementation parses the string value with the given parser. If the source file is an Excel file, the numeric value may be retrieved directly.
      Overrides:
      getInt in class FlatFileParser.Data
    • getLong

      public Long getLong(int index, NumberFormat parser, boolean nullIfException)
      Description copied from class: FlatFileParser.Data
      Get the value as a long. The default implementation parses the string value with the given parser. If the source file is an Excel file, the numeric value may be retrieved directly.
      Overrides:
      getLong in class FlatFileParser.Data
    • getFloat

      public Float getFloat(int index, NumberFormat parser, boolean nullIfException)
      Description copied from class: FlatFileParser.Data
      Get the value as a float. The default implementation parses the string value with the given parser. If the source file is an Excel file, the numeric value may be retrieved directly.
      Overrides:
      getFloat in class FlatFileParser.Data
    • getDouble

      public Double getDouble(int index, NumberFormat parser, boolean nullIfException)
      Description copied from class: FlatFileParser.Data
      Get the value as a double. The default implementation parses the string value with the given parser. If the source file is an Excel file, the numeric value may be retrieved directly.
      Overrides:
      getDouble in class FlatFileParser.Data
    • getDate

      public Date getDate(int index, Formatter<Date> parser, boolean nullIfException)
      Description copied from class: FlatFileParser.Data
      Get the value as a date. The default implementation parses the string value with the given parser. If the source file is an Excel file, the date value may be retrieved directly.
      Overrides:
      getDate in class FlatFileParser.Data