Package io.github.dornol.excelkit.csv
Enum Class CsvDialect
- All Implemented Interfaces:
Serializable,Comparable<CsvDialect>,Constable
Predefined CSV dialect configurations for common formats.
Use with CsvWriter.dialect(CsvDialect) or CsvReader.dialect(CsvDialect)
to quickly configure delimiter, charset, and BOM settings.
// Tab-separated values
CsvWriter.<Item>create()
.dialect(CsvDialect.TSV)
.column("Name", Item::name)
.write(stream);
// Excel-compatible CSV (UTF-8 BOM)
CsvWriter.<Item>create()
.dialect(CsvDialect.EXCEL)
.column("Name", Item::name)
.write(stream);
- Since:
- 0.9.2
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionReturns the character encoding.charReturns the field delimiter character.booleanisBom()Returns whether a UTF-8 BOM should be written.static CsvDialectReturns the enum constant of this class with the specified name.static CsvDialect[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RFC4180
RFC 4180 standard: comma delimiter, UTF-8, no BOM. -
EXCEL
Excel-compatible: comma delimiter, UTF-8 with BOM for proper Korean/CJK display. -
TSV
Tab-separated values: tab delimiter, UTF-8, no BOM. -
PIPE
Pipe-separated values: pipe delimiter, UTF-8, no BOM.
-
-
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
-
getDelimiter
public char getDelimiter()Returns the field delimiter character.- Returns:
- the delimiter character
-
getCharset
Returns the character encoding.- Returns:
- the charset
-
isBom
public boolean isBom()Returns whether a UTF-8 BOM should be written.- Returns:
- true if BOM is enabled
-