Class AutoFormatter

java.lang.Object
net.sf.basedb.util.excel.AutoFormatter
All Implemented Interfaces:
ExcelFormatter<Object,Object>

public class AutoFormatter extends Object implements ExcelFormatter<Object,Object>
Excel formatter implementation that automatically selects a format depending on the type/class of the value. Null values are created as empty cells: ExcelValue.emptyCell() Integer and Long values are created as numeric cells with no decimals: ExcelValue.asInt(Number) Other numeric values are created as numeric cell without format specification: ExcelValue.asNumber(Number, int) Date values with time at midnight are created as numeric cells with date formatting applied: ExcelValue.asDate(Date, String) Date values with other times are created as numeric cells with timestamp formatting applied: ExcelValue.asTimestamp(Date, String) Boolean values are created as numeric cells (0 or 1) with BOOLEAN format: ExcelValue.asBoolean(Boolean) All other values are created as string values via their toString() method: ExcelValue.asString(String)
Since:
3.15
Author:
nicklas
  • Field Details

    • dateFormat

      private String dateFormat
    • timestampFormat

      private String timestampFormat
  • Constructor Details

    • AutoFormatter

      public AutoFormatter()
  • Method Details