Class ExcelValue<T>

    • Constructor Detail

      • ExcelValue

        protected ExcelValue​(T value,
                             String format)
    • Method Detail

      • emptyCell

        public static final <T> ExcelValue<T> emptyCell()
        This creates a blank cell.
      • asDate

        public static ExcelValue<Date> asDate​(Date value,
                                              String javaFormat)
        Create a date cell value. The cell will be formatted according to the specified format string which should be given as a Java-compatible format string. If no format is specified "yyyy-MM-dd" is used.
      • asTimestamp

        public static ExcelValue<Date> asTimestamp​(Date value,
                                                   String javaFormat)
        Create a timestamp cell value. The cell will be formatted according to the specified format string which should be given as a Java-compatible format string. If no format is specified "yyyy-MM-dd HH:mm:ss" is used. Note! There is really no difference between this metod and the asDate(Date, String) method except for the default format string.
      • asNumber

        public static final ExcelValue<Number> asNumber​(Number value,
                                                        int numDecimals)
        Create a numeric cell value and display a given number of decimals. The numDecimals should be between 0 and 15, or the "General" format will be used.
      • asNumber

        public static final ExcelValue<Number> asNumber​(Number value,
                                                        String format)
        Create a numeric cell value with a custom numeric format.
      • asBoolean

        public static final ExcelValue<Boolean> asBoolean​(Boolean value)
        Create a numeric cell value with boolean format.
      • numberFormat

        public static String numberFormat​(int numDecimals)
        Creates a format string for formatting numbers with the given number of decimals (between 0 and 15).
      • getValue

        public T getValue()
        Get the stored value.
      • getFormat

        public String getFormat()
        Get the format string.
      • writeTo

        public abstract void writeTo​(org.apache.poi.ss.usermodel.Cell cell,
                                     CellStyleCreator styleCreator)
        Write the value to the given cell and apply a format to it with the help of the style creator. If no style creator is given, the cell is not formatted.