Enum Class ExcelDataType
- All Implemented Interfaces:
Serializable,Comparable<ExcelDataType>,Constable
Each type defines how to write a specific Java type into an Excel cell and optionally provides a default number/date format for styling.
This enum is used to simplify type-safe column setup in ExcelColumn.
- Since:
- 2025-07-19
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBigDecimal converted to double (2 decimal places).BigDecimal converted to long (no decimal).Boolean values are converted to "Y" or "N".LocalDate formatted as "yyyy-MM-dd".LocalDateTime formatted as "yyyy-MM-dd HH:mm:ss".Double value with 2 decimal places.Double value interpreted as a percentage (e.g.Float value with 2 decimal places.Float value interpreted as a percentage.Formula type.Hyperlink type.Image type.Integer value.Long integer value.Rich text type.Generic string type.LocalTime formatted as "HH:mm:ss". -
Method Summary
Modifier and TypeMethodDescriptionstatic ExcelDataTypeReturns the enum constant of this class with the specified name.static ExcelDataType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STRING
Generic string type. CallsString.valueOf(value). -
BOOLEAN_TO_YN
Boolean values are converted to "Y" or "N". -
LONG
Long integer value. -
INTEGER
Integer value. -
DOUBLE
Double value with 2 decimal places. -
FLOAT
Float value with 2 decimal places. -
DOUBLE_PERCENT
Double value interpreted as a percentage (e.g. 0.25 → 25%). -
FLOAT_PERCENT
Float value interpreted as a percentage. -
DATETIME
LocalDateTime formatted as "yyyy-MM-dd HH:mm:ss". -
DATE
LocalDate formatted as "yyyy-MM-dd". -
TIME
LocalTime formatted as "HH:mm:ss". -
BIG_DECIMAL_TO_DOUBLE
BigDecimal converted to double (2 decimal places). -
BIG_DECIMAL_TO_LONG
BigDecimal converted to long (no decimal). -
FORMULA
Formula type. The value is treated as an Excel formula string (without leading '=').Example:
"SUM(A2:A100)"or"AVERAGE(B2:B50)"Security warning: Do not pass untrusted user input as formula values. DDE formulas (e.g.,
cmd|'/c calc') can execute arbitrary commands when the Excel file is opened. Always use hardcoded or validated formula strings.Note: No runtime guard is applied here because DDE pipe syntax is used by legitimate integrations (e.g., Bloomberg
Bloomberg|'USDKRW Curncy'!Last, Reuters). Blocking pipe characters would break these use cases. Input validation is the caller's responsibility. -
HYPERLINK
Hyperlink type. Creates a clickable URL link in the cell.Accepts either a plain
String(used as both URL and label) or anExcelHyperlinkinstance (separate URL and label). -
IMAGE
Image type. Embeds an image in the cell.Accepts an
ExcelImageinstance containing the image bytes and type. The image is anchored to the cell and auto-sized. -
RICH_TEXT
Rich text type. Creates a cell with mixed formatting (partial bold, italic, colors, etc.).Accepts an
ExcelRichTextinstance built using its fluent API. If the value is not anExcelRichText, it falls back toString.valueOf(value).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-