Skip to content

Commit 88efa32

Browse files
committed
Javadoc
1 parent f7dfe3e commit 88efa32

File tree

1 file changed

+39
-18
lines changed

1 file changed

+39
-18
lines changed

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

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -188,26 +188,41 @@ public final class CSVFormat implements Serializable {
188188
public static class Builder implements Supplier<CSVFormat> {
189189

190190
/**
191-
* Creates a new default builder.
191+
* Creates a new default builder, as for {@link #RFC4180} but allowing empty lines.
192+
*
193+
* <p>
194+
* The {@link Builder} settings are:
195+
* </p>
196+
* <ul>
197+
* <li>{@code setDelimiter(',')}</li>
198+
* <li>{@code setQuote('"')}</li>
199+
* <li>{@code setRecordSeparator("\r\n")}</li>
200+
* <li>{@code setIgnoreEmptyLines(true)}</li>
201+
* <li>{@code setDuplicateHeaderMode(DuplicateHeaderMode.ALLOW_ALL)}</li>
202+
* <li>All other values take their Java defaults, false for boolean, null for objects.</li>
203+
* </ul>
204+
*
205+
* @see Predefined#Default
206+
* @see DuplicateHeaderMode#ALLOW_ALL
192207
*
193208
* @return a copy of the builder
194209
*/
195210
public static Builder create() {
196211
// @formatter:off
197212
return new Builder()
198213
.setDelimiter(Constants.COMMA)
199-
.setRecordSeparator(Constants.CRLF)
200214
.setQuote(Constants.DOUBLE_QUOTE_CHAR)
215+
.setRecordSeparator(Constants.CRLF)
201216
.setIgnoreEmptyLines(true)
202217
.setDuplicateHeaderMode(DuplicateHeaderMode.ALLOW_ALL);
203218
// @formatter:on
204219
}
205220

206221
/**
207-
* Creates a new builder for the given format.
222+
* Creates a new builder from the given format.
208223
*
209224
* @param csvFormat the source format.
210-
* @return a copy of the builder
225+
* @return a new builder.
211226
*/
212227
public static Builder create(final CSVFormat csvFormat) {
213228
return new Builder(csvFormat);
@@ -981,6 +996,7 @@ public CSVFormat getFormat() {
981996
* </ul>
982997
*
983998
* @see Predefined#Default
999+
* @see DuplicateHeaderMode#ALLOW_ALL
9841000
*/
9851001
public static final CSVFormat DEFAULT = new CSVFormat(Builder.create());
9861002

@@ -997,7 +1013,7 @@ public CSVFormat getFormat() {
9971013
* </pre>
9981014
*
9991015
* <p>
1000-
* The {@link Builder} settings are:
1016+
* The {@link Builder} settings are the {@link #DEFAULT} <em>with</em>:
10011017
* </p>
10021018
* <ul>
10031019
* <li>{@code setDelimiter(',')}</li>
@@ -1015,6 +1031,7 @@ public CSVFormat getFormat() {
10151031
* </p>
10161032
*
10171033
* @see Predefined#Excel
1034+
* @see DuplicateHeaderMode#ALLOW_ALL
10181035
*/
10191036
// @formatter:off
10201037
public static final CSVFormat EXCEL = DEFAULT.builder()
@@ -1034,7 +1051,7 @@ public CSVFormat getFormat() {
10341051
* </p>
10351052
*
10361053
* <p>
1037-
* The {@link Builder} settings are:
1054+
* The {@link Builder} settings are the {@link #DEFAULT} <em>with</em>:
10381055
* </p>
10391056
* <ul>
10401057
* <li>{@code setDelimiter(',')}</li>
@@ -1066,7 +1083,7 @@ public CSVFormat getFormat() {
10661083
* </p>
10671084
*
10681085
* <p>
1069-
* The {@link Builder} settings are:
1086+
* The {@link Builder} settings are the {@link #DEFAULT} <em>with</em>:
10701087
* </p>
10711088
* <ul>
10721089
* <li>{@code setDelimiter(',')}</li>
@@ -1104,7 +1121,7 @@ public CSVFormat getFormat() {
11041121
* not a valid escape character. If you use double-quotes to enclose fields in the CSV data, you must escape internal double-quote marks by prepending
11051122
* another double-quote. </blockquote>
11061123
* <p>
1107-
* The {@link Builder} settings are:
1124+
* The {@link Builder} settings are the {@link #DEFAULT} <em>with</em>:
11081125
* </p>
11091126
* <ul>
11101127
* <li>{@code setDelimiter(',')}</li>
@@ -1115,6 +1132,7 @@ public CSVFormat getFormat() {
11151132
* </ul>
11161133
*
11171134
* @see Predefined#MongoDBCsv
1135+
* @see QuoteMode#ALL_NON_NULL
11181136
* @see <a href="https://docs.mongodb.com/manual/reference/program/mongoexport/">MongoDB mongoexport command documentation</a>
11191137
* @since 1.7
11201138
*/
@@ -1140,7 +1158,7 @@ public CSVFormat getFormat() {
11401158
* </p>
11411159
*
11421160
* <p>
1143-
* The {@link Builder} settings are:
1161+
* The {@link Builder} settings are the {@link #DEFAULT} <em>with</em>:
11441162
* </p>
11451163
* <ul>
11461164
* <li>{@code setDelimiter('\t')}</li>
@@ -1151,6 +1169,7 @@ public CSVFormat getFormat() {
11511169
* </ul>
11521170
*
11531171
* @see Predefined#MongoDBCsv
1172+
* @see QuoteMode#ALL_NON_NULL
11541173
* @see <a href="https://docs.mongodb.com/manual/reference/program/mongoexport/">MongoDB mongoexport command
11551174
* documentation</a>
11561175
* @since 1.7
@@ -1174,7 +1193,7 @@ public CSVFormat getFormat() {
11741193
* </p>
11751194
*
11761195
* <p>
1177-
* The {@link Builder} settings are:
1196+
* The {@link Builder} settings are the {@link #DEFAULT} <em>with</em>:
11781197
* </p>
11791198
* <ul>
11801199
* <li>{@code setDelimiter('\t')}</li>
@@ -1187,6 +1206,7 @@ public CSVFormat getFormat() {
11871206
* </ul>
11881207
*
11891208
* @see Predefined#MySQL
1209+
* @see QuoteMode#ALL_NON_NULL
11901210
* @see <a href="https://dev.mysql.com/doc/refman/5.1/en/load-data.html"> https://dev.mysql.com/doc/refman/5.1/en/load
11911211
* -data.html</a>
11921212
*/
@@ -1212,7 +1232,7 @@ public CSVFormat getFormat() {
12121232
* </p>
12131233
*
12141234
* <p>
1215-
* The {@link Builder} settings are:
1235+
* The {@link Builder} settings are the {@link #DEFAULT} <em>with</em>:
12161236
* </p>
12171237
* <ul>
12181238
* <li>{@code setDelimiter(',') // default is {@code FIELDS TERMINATED BY ','}}</li>
@@ -1226,6 +1246,7 @@ public CSVFormat getFormat() {
12261246
* </ul>
12271247
*
12281248
* @see Predefined#Oracle
1249+
* @see QuoteMode#MINIMAL
12291250
* @see <a href="https://s.apache.org/CGXG">Oracle CSV Format Specification</a>
12301251
* @since 1.6
12311252
*/
@@ -1251,7 +1272,7 @@ public CSVFormat getFormat() {
12511272
* </p>
12521273
*
12531274
* <p>
1254-
* The {@link Builder} settings are:
1275+
* The {@link Builder} settings are the {@link #DEFAULT} <em>with</em>:
12551276
* </p>
12561277
* <ul>
12571278
* <li>{@code setDelimiter(',')}</li>
@@ -1264,6 +1285,7 @@ public CSVFormat getFormat() {
12641285
* </ul>
12651286
*
12661287
* @see Predefined#MySQL
1288+
* @see QuoteMode#ALL_NON_NULL
12671289
* @see <a href="https://www.postgresql.org/docs/current/static/sql-copy.html">PostgreSQL COPY command
12681290
* documentation</a>
12691291
* @since 1.5
@@ -1289,7 +1311,7 @@ public CSVFormat getFormat() {
12891311
* </p>
12901312
*
12911313
* <p>
1292-
* The {@link Builder} settings are:
1314+
* The {@link Builder} settings are the {@link #DEFAULT} <em>with</em>:
12931315
* </p>
12941316
* <ul>
12951317
* <li>{@code setDelimiter('\t')}</li>
@@ -1302,6 +1324,7 @@ public CSVFormat getFormat() {
13021324
* </ul>
13031325
*
13041326
* @see Predefined#MySQL
1327+
* @see QuoteMode#ALL_NON_NULL
13051328
* @see <a href="https://www.postgresql.org/docs/current/static/sql-copy.html">PostgreSQL COPY command
13061329
* documentation</a>
13071330
* @since 1.5
@@ -1322,7 +1345,7 @@ public CSVFormat getFormat() {
13221345
* Comma separated format as defined by <a href="https://tools.ietf.org/html/rfc4180">RFC 4180</a>.
13231346
*
13241347
* <p>
1325-
* The {@link Builder} settings are:
1348+
* The {@link Builder} settings are the {@link #DEFAULT} <em>with</em>:
13261349
* </p>
13271350
* <ul>
13281351
* <li>{@code setDelimiter(',')}</li>
@@ -1338,15 +1361,13 @@ public CSVFormat getFormat() {
13381361
private static final long serialVersionUID = 2L;
13391362

13401363
/**
1341-
* Tab-delimited format.
1364+
* Tab-delimited format (TDF).
13421365
*
13431366
* <p>
1344-
* The {@link Builder} settings are:
1367+
* The {@link Builder} settings are the {@link #DEFAULT} <em>with</em>:
13451368
* </p>
13461369
* <ul>
13471370
* <li>{@code setDelimiter('\t')}</li>
1348-
* <li>{@code setQuote('"')}</li>
1349-
* <li>{@code setRecordSeparator("\r\n")}</li>
13501371
* <li>{@code setIgnoreSurroundingSpaces(true)}</li>
13511372
* </ul>
13521373
*

0 commit comments

Comments
 (0)