public static class CsvTokenizer.Builder extends Object
CsvTokenizer.| Modifier and Type | Method and Description |
|---|---|
CsvTokenizer.Builder |
acceptStrayQuotesAssumingNoDelimitersInFields()
Sets to accept "stray quotes" under a special assumption that no delimiter character is included in fields.
|
CsvTokenizer |
build(Iterator<String> iterator)
Builds a
CsvTokenizer instancefrom this builder, with iteration of strings as comma-separated values (CSV). |
CsvTokenizer.Builder |
enableTrimIfNotQuoted()
Enables trimming a space character
' ' only if the field is not quoted. |
boolean |
isAcceptingStrayQuotesAssumingNoDelimitersInFields()
Deprecated.
Use this method only for purpose of testing. No guarantees to be maintained.
|
boolean |
isEnabledTrimIfNotQuoted()
Deprecated.
Use this method only for purpose of testing. No guarantees to be maintained.
|
CsvTokenizer.Builder |
noEscape()
Disables escaping.
|
CsvTokenizer.Builder |
noQuote()
Disables quoting.
|
String |
peekCommentLineMarker()
Deprecated.
Use this method only for purpose of testing. No guarantees to be maintained.
|
char |
peekEscape()
Deprecated.
Use this method only for purpose of testing. No guarantees to be maintained.
|
long |
peekMaxQuotedFieldLength()
Deprecated.
Use this method only for purpose of testing. No guarantees to be maintained.
|
String |
peekNewline()
Deprecated.
Use this method only for purpose of testing. No guarantees to be maintained.
|
String |
peekNullString()
Deprecated.
Use this method only for purpose of testing. No guarantees to be maintained.
|
char |
peekQuote()
Deprecated.
Use this method only for purpose of testing. No guarantees to be maintained.
|
CsvTokenizer.Builder |
setCommentLineMarker(String commentLineMarker)
Sets a marker string to indicate that a line is commented-out.
|
CsvTokenizer.Builder |
setEscape(char escape)
Enables escaping, and sets a character for escaping.
|
CsvTokenizer.Builder |
setMaxQuotedFieldLength(long maxQuotedFieldLength)
Sets the maximum length of quoted fields.
|
CsvTokenizer.Builder |
setNewline(String newline)
Sets a string to take place in a column value string tokenized from a quoted field containing an end-of-line.
|
CsvTokenizer.Builder |
setNullString(String nullString)
Sets a special string in the CSV that is considered as
null. |
CsvTokenizer.Builder |
setQuote(char quote)
Enables quoting, and sets a character for quoting.
|
@Deprecated public char peekQuote()
public CsvTokenizer.Builder setQuote(char quote)
quote - a character for quotingpublic CsvTokenizer.Builder noQuote()
@Deprecated public char peekEscape()
public CsvTokenizer.Builder setEscape(char escape)
escape - a character for escapingpublic CsvTokenizer.Builder noEscape()
@Deprecated public String peekNewline()
public CsvTokenizer.Builder setNewline(String newline)
newline - a newline string that is one of "\r\n", "\r", or "\n".NullPointerException - if newline is nullIllegalArgumentException - if newline is invalid@Deprecated public boolean isEnabledTrimIfNotQuoted()
true if enabled to trim a space character ' ' only if the field is not quoted, or false otherwise.true if enabled to trim a space character ' ' only if the field is not quoted, or false otherwisepublic CsvTokenizer.Builder enableTrimIfNotQuoted()
' ' only if the field is not quoted.@Deprecated public boolean isAcceptingStrayQuotesAssumingNoDelimitersInFields()
true if it accepts "stray quotes" under a special assumption that no delimiter character is included in fields, or false otherwise.true if it accepts "stray quotes" under a special assumption that no delimiter character is included in fields, or false otherwisepublic CsvTokenizer.Builder acceptStrayQuotesAssumingNoDelimitersInFields()
@Deprecated public long peekMaxQuotedFieldLength()
public CsvTokenizer.Builder setMaxQuotedFieldLength(long maxQuotedFieldLength)
maxQuotedFieldLength - the maximum length of quoted fields@Deprecated public String peekCommentLineMarker()
public CsvTokenizer.Builder setCommentLineMarker(String commentLineMarker)
commentLineMarker - a marker string to indicate that a line is commented-out (ex. "#", "//")@Deprecated public String peekNullString()
null.nullpublic CsvTokenizer.Builder setNullString(String nullString)
null.nullString - a special string in the CSV that is considered as null (ex. "NULL")public CsvTokenizer build(Iterator<String> iterator)
CsvTokenizer instancefrom this builder, with iteration of strings as comma-separated values (CSV).iterator - iteration of strings as comma-separated values (CSV)CsvTokenizer instanceIllegalStateException - if the builder is configured with an invalid combination