Interface ExcelCellStyleDecorator

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ExcelCellStyleDecorator
A functional interface for applying styling to Excel cells based on their location. Provides factory methods for common cell styling operations such as:
  • Text formatting (bold, italic, underline)
  • Colors (font color, background color)
  • Text wrapping
  • Data formats (number formatting, date formatting)
Multiple decorators can be combined using the and(ExcelCellStyleDecorator) method.
See Also:
  • Method Details

    • decorate

      void decorate(FieldLocation fieldLocation, ExcelCellStyle style)
      Applies styling to the given Excel cell style based on the field location.
      Parameters:
      fieldLocation - the location of the field being styled
      style - the cell style to modify
    • and

      Returns a composed decorator that applies this decorator and then the other decorator.
      Parameters:
      other - the decorator to apply after this one
      Returns:
      a composed decorator
      Throws:
      NullPointerException - if other is null
    • wrapText

      static ExcelCellStyleDecorator wrapText()
      Returns a decorator that enables text wrapping.
      Returns:
      a decorator that sets wrapText to true
    • bold

      static ExcelCellStyleDecorator bold()
      Returns a decorator that makes text bold.
      Returns:
      a decorator that sets font bold to true
    • italic

      static ExcelCellStyleDecorator italic()
      Returns a decorator that makes text italic.
      Returns:
      a decorator that sets font italic to true
    • underline

      static ExcelCellStyleDecorator underline()
      Returns a decorator that underlines text.
      Returns:
      a decorator that sets font underline to true
    • fontColor

      static ExcelCellStyleDecorator fontColor(ExcelColor fontColor)
      Returns a decorator that sets the font color.
      Parameters:
      fontColor - the font color to set
      Returns:
      a decorator that sets the font color
    • fontColor

      static ExcelCellStyleDecorator fontColor(ExcelColorPalette fontColor)
      Returns a decorator that sets the font color using a palette color.
      Parameters:
      fontColor - the palette color to use for the font
      Returns:
      a decorator that sets the font color
    • backgroundColor

      static ExcelCellStyleDecorator backgroundColor(ExcelColor backgroundColor)
      Returns a decorator that sets the background color.
      Parameters:
      backgroundColor - the background color to set
      Returns:
      a decorator that sets the background color
    • backgroundColor

      static ExcelCellStyleDecorator backgroundColor(ExcelColorPalette backgroundColor)
      Returns a decorator that sets the background color using a palette color.
      Parameters:
      backgroundColor - the palette color to use for the background
      Returns:
      a decorator that sets the background color
    • dataFormat

      static ExcelCellStyleDecorator dataFormat(String dataFormat)
      Returns a decorator that sets the data format string for the cell.
      Parameters:
      dataFormat - the data format string to set (e.g., "0.00" for decimals, "m/d/yy" for dates)
      Returns:
      a decorator that sets the data format
    • hyperlink

      static ExcelCellStyleDecorator hyperlink()
      Returns a decorator that applies the standard hyperlink style to the cell.

      This typically formats the cell using an underlined blue font, matching the default hyperlink appearance in Excel.

      Returns:
      a decorator that applies the hyperlink style to the cell