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.
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)
and(ExcelCellStyleDecorator) method.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault ExcelCellStyleDecoratorand(ExcelCellStyleDecorator other) Returns a composed decorator that applies this decorator and then the other decorator.static ExcelCellStyleDecoratorbackgroundColor(ExcelColor backgroundColor) Returns a decorator that sets the background color.static ExcelCellStyleDecoratorbackgroundColor(ExcelColorPalette backgroundColor) Returns a decorator that sets the background color using a palette color.static ExcelCellStyleDecoratorbold()Returns a decorator that makes text bold.static ExcelCellStyleDecoratordataFormat(String dataFormat) Returns a decorator that sets the data format string for the cell.voiddecorate(FieldLocation fieldLocation, ExcelCellStyle style) Applies styling to the given Excel cell style based on the field location.static ExcelCellStyleDecoratorfontColor(ExcelColor fontColor) Returns a decorator that sets the font color.static ExcelCellStyleDecoratorfontColor(ExcelColorPalette fontColor) Returns a decorator that sets the font color using a palette color.static ExcelCellStyleDecoratorReturns a decorator that applies the standard hyperlink style to the cell.static ExcelCellStyleDecoratoritalic()Returns a decorator that makes text italic.static ExcelCellStyleDecoratorReturns a decorator that underlines text.static ExcelCellStyleDecoratorwrapText()Returns a decorator that enables text wrapping.
-
Method Details
-
decorate
Applies styling to the given Excel cell style based on the field location.- Parameters:
fieldLocation- the location of the field being styledstyle- 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
Returns a decorator that enables text wrapping.- Returns:
- a decorator that sets wrapText to true
-
bold
Returns a decorator that makes text bold.- Returns:
- a decorator that sets font bold to true
-
italic
Returns a decorator that makes text italic.- Returns:
- a decorator that sets font italic to true
-
underline
Returns a decorator that underlines text.- Returns:
- a decorator that sets font underline to true
-
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
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
Returns a decorator that sets the background color.- Parameters:
backgroundColor- the background color to set- Returns:
- a decorator that sets the background color
-
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
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
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
-