Top Description Inners Fields Constructors Methods
org.jooq

public final Class CSVFormat

extends Object
Class Inheritance
Static Imports
org.jooq.CSVFormat.Quote.SPECIAL_CHARACTERS

A CSV formatting type, which can be used to configure CSV imports / exports.

The type is immutable, meaning calls to setters like delimiter(char) do not modify the original reference, but return a new one instead.

Author
Lukas Eder

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
CSVFormat.Quote

When to apply the quote

Field Summary

Modifier and TypeField and Description
public static final CSVFormat
pack-priv final String
pack-priv final String
pack-priv final boolean
pack-priv final String
pack-priv final String
pack-priv final CSVFormat.Quote
pack-priv final String

Constructor Summary

AccessConstructor and Description
public
private
CSVFormat(String delimiter, String nullString, String emptyString, String newline, String quoteString, CSVFormat.Quote quote, boolean header)

Method Summary

Modifier and TypeMethod and Description
public @NotNull CSVFormat
delimiter(String newDelimiter)

The delimiter to be used between CSV cells, defaulting to ",".

public @NotNull CSVFormat
delimiter(char newDelimiter)

The delimiter to be used between CSV cells, defaulting to ",".

public @NotNull String
delimiter()

The delimiter to be used between CSV cells, defaulting to ",".

public @NotNull CSVFormat
emptyString(String newEmptyString)

The string to be used for "" values, defaulting to the empty string.

public @NotNull String
emptyString()

The string to be used for "" values, defaulting to the empty string.

public @NotNull CSVFormat
header(boolean newHeader)

Whether to emit a header row with column names, defaulting to true.

public boolean
header()

Whether to emit a header row with column names, defaulting to true.

public @NotNull CSVFormat
newline(String newNewline)

The string to be used to separate rows, defaulting to \n.

public @NotNull String
newline()

The string to be used to separate rows, defaulting to \n.

public @NotNull CSVFormat
nullString(String newNullString)

The string to be used for null values, defaulting to the empty string.

public @NotNull String
nullString()

The string to be used for null values, defaulting to the empty string.

public @NotNull CSVFormat
quote(CSVFormat.Quote newQuote)

When to quote CSV content.

public @NotNull CSVFormat.Quote
quote()

When to quote CSV content.

public @NotNull CSVFormat
quoteString(String newQuoteString)

The string used to quote values according to the rules specified in quote().

public @NotNull String
quoteString()

The string used to quote values according to the rules specified in quote().

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULTback to summary
public static final CSVFormat DEFAULT
delimiterback to summary
pack-priv final String delimiter
emptyStringback to summary
pack-priv final String emptyString
newlineback to summary
pack-priv final String newline
nullStringback to summary
pack-priv final String nullString
quoteback to summary
pack-priv final CSVFormat.Quote quote
quoteStringback to summary
pack-priv final String quoteString

Constructor Detail

CSVFormatback to summary
public CSVFormat()
CSVFormatback to summary
private CSVFormat(String delimiter, String nullString, String emptyString, String newline, String quoteString, CSVFormat.Quote quote, boolean header)

Method Detail

delimiterback to summary
public @NotNull CSVFormat delimiter(String newDelimiter)

The delimiter to be used between CSV cells, defaulting to ",".

Using "," a,b,c
Using ";" a;b;c
Annotations
@NotNull
delimiterback to summary
public @NotNull CSVFormat delimiter(char newDelimiter)

The delimiter to be used between CSV cells, defaulting to ",".

Using "," a,b,c
Using ";" a;b;c
Annotations
@NotNull
delimiterback to summary
public @NotNull String delimiter()

The delimiter to be used between CSV cells, defaulting to ",".

Using "," a,b,c
Using ";" a;b;c
Annotations
@NotNull
emptyStringback to summary
public @NotNull CSVFormat emptyString(String newEmptyString)

The string to be used for "" values, defaulting to the empty string.

Using "" a,,c
Using "\"\"" a,"",c
Annotations
@NotNull
emptyStringback to summary
public @NotNull String emptyString()

The string to be used for "" values, defaulting to the empty string.

Using "" a,,c
Using "\"\"" a,"",c
Annotations
@NotNull
headerback to summary
public @NotNull CSVFormat header(boolean newHeader)

Whether to emit a header row with column names, defaulting to true.

Annotations
@NotNull
headerback to summary
public boolean header()

Whether to emit a header row with column names, defaulting to true.

newlineback to summary
public @NotNull CSVFormat newline(String newNewline)

The string to be used to separate rows, defaulting to \n.

Annotations
@NotNull
newlineback to summary
public @NotNull String newline()

The string to be used to separate rows, defaulting to \n.

Annotations
@NotNull
nullStringback to summary
public @NotNull CSVFormat nullString(String newNullString)

The string to be used for null values, defaulting to the empty string.

Using "" a,,c
Using "\"\"" a,"",c
Using "{null}" a,{null},c
Annotations
@NotNull
nullStringback to summary
public @NotNull String nullString()

The string to be used for null values, defaulting to the empty string.

Using "" a,,c
Using "\"\"" a,"",c
Using "{null}" a,{null},c
Annotations
@NotNull
quoteback to summary
public @NotNull CSVFormat quote(CSVFormat.Quote newQuote)

When to quote CSV content.

Annotations
@NotNull
quoteback to summary
public @NotNull CSVFormat.Quote quote()

When to quote CSV content.

Annotations
@NotNull
quoteStringback to summary
public @NotNull CSVFormat quoteString(String newQuoteString)

The string used to quote values according to the rules specified in quote().

Annotations
@NotNull
quoteStringback to summary
public @NotNull String quoteString()

The string used to quote values according to the rules specified in quote().

Annotations
@NotNull
org.jooq back to summary

public final Enum CSVFormat.Quote

extends Enum<CSVFormat.Quote>
Class Inheritance

When to apply the quote

Field Summary

Modifier and TypeField and Description
public static final CSVFormat.Quote
ALWAYS

Each content element is quoted.

public static final CSVFormat.Quote
NEVER

Content is never quoted.

public static final CSVFormat.Quote
SPECIAL_CHARACTERS

Only content elements are quoted containing special characters.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static CSVFormat.Quote
public static CSVFormat.Quote[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALWAYSback to summary
public static final CSVFormat.Quote ALWAYS

Each content element is quoted.

NEVERback to summary
public static final CSVFormat.Quote NEVER

Content is never quoted.

SPECIAL_CHARACTERSback to summary
public static final CSVFormat.Quote SPECIAL_CHARACTERS

Only content elements are quoted containing special characters.

Special characters consist of:

  • ,: The comma
  • ;: The semi colon
  • ": The double quote
  • ': The apostrophe
  • \: The backslash
  • \t: The tab character
  • \n: The line feed character
  • \r: The carriage return character

Constructor Detail

Quoteback to summary
private Quote()

Method Detail

valueOfback to summary
public static CSVFormat.Quote valueOf(String name)
valuesback to summary
public static CSVFormat.Quote[] values()