Skip to content

Commit fc4c0e3

Browse files
committed
document trailing delimiter parse behavior and contrast with trailing data
1 parent 609a228 commit fc4c0e3

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,16 @@ public Builder setTrailingData(final boolean trailingData) {
883883
/**
884884
* Sets whether to add a trailing delimiter.
885885
*
886+
* <p>
887+
* When writing, a delimiter is appended after the last value of each record. When reading, the empty field
888+
* that such a trailing delimiter produces is dropped so the output round-trips back to the original record;
889+
* a quoted empty trailing field ({@code ""}) is a real value rather than a trailing delimiter and is kept.
890+
* </p>
891+
* <p>
892+
* This is unrelated to {@link #setTrailingData(boolean) trailing data}, which controls whether characters
893+
* after the closing quote of an encapsulated value are tolerated when reading.
894+
* </p>
895+
*
886896
* @param trailingDelimiter whether to add a trailing delimiter.
887897
* @return This instance.
888898
*/
@@ -2012,6 +2022,16 @@ public boolean getTrailingData() {
20122022
/**
20132023
* Gets whether to add a trailing delimiter.
20142024
*
2025+
* <p>
2026+
* When writing, a delimiter is appended after the last value of each record. When reading, the empty field
2027+
* that such a trailing delimiter produces is dropped so the output round-trips back to the original record;
2028+
* a quoted empty trailing field ({@code ""}) is a real value rather than a trailing delimiter and is kept.
2029+
* </p>
2030+
* <p>
2031+
* This is unrelated to {@link #getTrailingData() trailing data}, which controls whether characters after the
2032+
* closing quote of an encapsulated value are tolerated when reading.
2033+
* </p>
2034+
*
20152035
* @return whether to add a trailing delimiter.
20162036
* @since 1.3
20172037
*/

0 commit comments

Comments
 (0)