Skip to content

Commit 105f907

Browse files
committed
CSV-78 Use Character instead of char for char fields except delimiter
Already done as part of CSV-99 etc. Updated Javadoc to clarify that null can be used to disable settings git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1509239 13f79535-47bb-0310-9956-ffa450edef68
1 parent cf764bc commit 105f907

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

src/main/java/org/apache/commons/csv/CSVFormat.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ static boolean isLineBreak(final Character c) {
6868
}
6969

7070
private final char delimiter;
71-
private final Character quoteChar;
71+
private final Character quoteChar; // null if quoting is disabled
7272
private final Quote quotePolicy;
73-
private final Character commentStart;
74-
private final Character escape;
73+
private final Character commentStart; // null if commenting is disabled
74+
private final Character escape; // null if escaping is disabled
7575
private final boolean ignoreSurroundingSpaces; // Should leading/trailing spaces be ignored around values?
7676
private final boolean ignoreEmptyLines;
7777
private final String recordSeparator; // for outputs
78-
private final String nullString;
78+
private final String nullString; // the string to be used for null values
7979
private final String[] header;
8080
private final boolean skipHeaderRecord;
8181

@@ -177,13 +177,13 @@ public static CSVFormat newFormat(final char delimiter) {
177177
* @param delimiter
178178
* the char used for value separation, must not be a line break character
179179
* @param quoteChar
180-
* the char used as value encapsulation marker
180+
* the Character used as value encapsulation marker, may be {@code null} to disable
181181
* @param quotePolicy
182182
* the quote policy
183183
* @param commentStart
184-
* the char used for comment identification
184+
* the Character used for comment identification, may be {@code null} to disable
185185
* @param escape
186-
* the char used to escape special characters in values
186+
* the Character used to escape special characters in values, may be {@code null} to disable
187187
* @param ignoreSurroundingSpaces
188188
* <tt>true</tt> when whitespaces enclosing values should be ignored
189189
* @param ignoreEmptyLines
@@ -299,7 +299,7 @@ public String format(final Object... values) {
299299
/**
300300
* Returns the character marking the start of a line comment.
301301
*
302-
* @return the comment start marker.
302+
* @return the comment start marker, may be {@code null}
303303
*/
304304
public Character getCommentStart() {
305305
return commentStart;
@@ -317,7 +317,7 @@ public char getDelimiter() {
317317
/**
318318
* Returns the escape character.
319319
*
320-
* @return the escape character
320+
* @return the escape character, may be {@code null}
321321
*/
322322
public Character getEscape() {
323323
return escape;
@@ -372,7 +372,7 @@ public String getNullString() {
372372
/**
373373
* Returns the character used to encapsulate values containing special characters.
374374
*
375-
* @return the quoteChar character
375+
* @return the quoteChar character, may be {@code null}
376376
*/
377377
public Character getQuoteChar() {
378378
return quoteChar;
@@ -461,7 +461,7 @@ public boolean isQuoting() {
461461
*
462462
* @param in
463463
* the input stream
464-
* @return a parser over a stream of {@link #CSVRecord}s.
464+
* @return a parser over a stream of {@link CSVRecord}s.
465465
* @throws IOException
466466
* If an I/O error occurs
467467
*/
@@ -559,7 +559,7 @@ public CSVFormat withCommentStart(final char commentStart) {
559559
* Note that the comment start character is only recognised at the start of a line.
560560
*
561561
* @param commentStart
562-
* the comment start marker
562+
* the comment start marker, use {@code null} to disable
563563
* @return A new CSVFormat that is equal to this one but with the specified character as the comment start marker
564564
* @throws IllegalArgumentException
565565
* thrown if the specified character is a line break
@@ -606,7 +606,7 @@ public CSVFormat withEscape(final char escape) {
606606
* Sets the escape character of the format to the specified character.
607607
*
608608
* @param escape
609-
* the escape character
609+
* the escape character, use {@code null} to disable
610610
* @return A new CSVFormat that is equal to this but with the specified character as the escape character
611611
* @throws IllegalArgumentException
612612
* thrown if the specified character is a line break
@@ -704,7 +704,7 @@ public CSVFormat withQuoteChar(final char quoteChar) {
704704
* Sets the quoteChar of the format to the specified character.
705705
*
706706
* @param quoteChar
707-
* the quoteChar character
707+
* the quoteChar character, use {@code null} to disable
708708
* @return A new CSVFormat that is equal to this but with the specified character as quoteChar
709709
* @throws IllegalArgumentException
710710
* thrown if the specified character is a line break

0 commit comments

Comments
 (0)