You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/changes/changes.xml
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -41,14 +41,16 @@
41
41
</properties>
42
42
<body>
43
43
<releaseversion="1.10.1"date="2023-MM-DD"description="Feature and bug fix release (Java 8)">
44
+
<!-- ADD -->
45
+
<actionissue="CSV-308"type="fix"dev="ggregory"due-to="Buddhi De Silva, Gary Gregory">[Javadoc] Add example to CSVFormat#setHeaderComments() #344.</action>
44
46
<!-- FIX -->
45
47
<actionissue="CSV-306"type="fix"dev="ggregory"due-to="Sam Ng, Bruno P. Kinoshita">Replace deprecated method in user guide, update external link #324, #325.</action>
46
48
<actiontype="fix"dev="ggregory"due-to="Seth Falco, Bruno P. Kinoshita">Document duplicate header behavior #309.</action>
@@ -313,9 +313,34 @@ public Builder setAutoFlush(final boolean autoFlush) {
313
313
}
314
314
315
315
/**
316
-
* Sets the comment start marker, use {@code null} to disable.
317
-
*
318
-
* Note that the comment start character is only recognized at the start of a line.
316
+
* Sets the comment marker character, use {@code null} to disable comments.
317
+
* <p>
318
+
* The comment start character is only recognized at the start of a line.
319
+
* </p>
320
+
* <p>
321
+
* Comments are printed first, before headers.
322
+
* </p>
323
+
* <p>
324
+
* Use {@link #setCommentMarker(char)} or {@link #setCommentMarker(Character)} to set the comment marker written at the start of
325
+
* each comment line.
326
+
* </p>
327
+
* <p>
328
+
* If the comment marker is not set, then the header comments are ignored.
329
+
* </p>
330
+
* <p>
331
+
* For example:
332
+
* </p>
333
+
* <pre>
334
+
* builder.setCommentMarker('#')
335
+
* .setHeaderComments("Generated by Apache Commons CSV", Instant.ofEpochMilli(0));
336
+
* </pre>
337
+
* <p>
338
+
* writes:
339
+
* </p>
340
+
* <pre>
341
+
* # Generated by Apache Commons CSV.
342
+
* # 1970-01-01T00:00:00Z
343
+
* </pre>
319
344
*
320
345
* @param commentMarker the comment start marker, use {@code null} to disable.
321
346
* @return This instance.
@@ -327,9 +352,34 @@ public Builder setCommentMarker(final char commentMarker) {
327
352
}
328
353
329
354
/**
330
-
* Sets the comment start marker, use {@code null} to disable.
331
-
*
332
-
* Note that the comment start character is only recognized at the start of a line.
355
+
* Sets the comment marker character, use {@code null} to disable comments.
356
+
* <p>
357
+
* The comment start character is only recognized at the start of a line.
358
+
* </p>
359
+
* <p>
360
+
* Comments are printed first, before headers.
361
+
* </p>
362
+
* <p>
363
+
* Use {@link #setCommentMarker(char)} or {@link #setCommentMarker(Character)} to set the comment marker written at the start of
364
+
* each comment line.
365
+
* </p>
366
+
* <p>
367
+
* If the comment marker is not set, then the header comments are ignored.
368
+
* </p>
369
+
* <p>
370
+
* For example:
371
+
* </p>
372
+
* <pre>
373
+
* builder.setCommentMarker('#')
374
+
* .setHeaderComments("Generated by Apache Commons CSV", Instant.ofEpochMilli(0));
375
+
* </pre>
376
+
* <p>
377
+
* writes:
378
+
* </p>
379
+
* <pre>
380
+
* # Generated by Apache Commons CSV.
381
+
* # 1970-01-01T00:00:00Z
382
+
* </pre>
333
383
*
334
384
* @param commentMarker the comment start marker, use {@code null} to disable.
335
385
* @return This instance.
@@ -521,13 +571,36 @@ public Builder setHeader(final String... header) {
521
571
}
522
572
523
573
/**
524
-
* Sets the header comments set to the given values. The comments will be printed first with the provided comment marker set by {@link Builder#setCommentMarker(char)}, before the headers. This setting is ignored by the parser.
525
-
*
574
+
* Sets the header comments to write before the CSV data.
575
+
* <p>
576
+
* This setting is ignored by the parser.
577
+
* </p>
578
+
* <p>
579
+
* Comments are printed first, before headers.
580
+
* </p>
581
+
* <p>
582
+
* Use {@link #setCommentMarker(char)} or {@link #setCommentMarker(Character)} to set the comment marker written at the start of
583
+
* each comment line.
584
+
* </p>
585
+
* <p>
586
+
* If the comment marker is not set, then the header comments are ignored.
587
+
* </p>
588
+
* <p>
589
+
* For example:
590
+
* </p>
591
+
* <pre>
592
+
* builder.setCommentMarker('#')
593
+
* .setHeaderComments("Generated by Apache Commons CSV", Instant.ofEpochMilli(0));
594
+
* </pre>
595
+
* <p>
596
+
* writes:
597
+
* </p>
526
598
* <pre>
527
-
* builder.setHeaderComments("Generated by Apache Commons CSV.", Instant.now());
599
+
* # Generated by Apache Commons CSV.
600
+
* # 1970-01-01T00:00:00Z
528
601
* </pre>
529
602
*
530
-
* @param headerComments the headerComments which will be printed by the Printer before the actual CSV data.
603
+
* @param headerComments the headerComments which will be printed by the Printer before the CSV data.
@@ -536,13 +609,36 @@ public Builder setHeaderComments(final Object... headerComments) {
536
609
}
537
610
538
611
/**
539
-
* Sets the header comments set to the given values. The comments will be printed first with the provided comment marker set by {@link Builder#setCommentMarker(char)}, before the headers. This setting is ignored by the parser.
540
-
*
612
+
* Sets the header comments to write before the CSV data.
613
+
* <p>
614
+
* This setting is ignored by the parser.
615
+
* </p>
616
+
* <p>
617
+
* Comments are printed first, before headers.
618
+
* </p>
619
+
* <p>
620
+
* Use {@link #setCommentMarker(char)} or {@link #setCommentMarker(Character)} to set the comment marker written at the start of
621
+
* each comment line.
622
+
* </p>
623
+
* <p>
624
+
* If the comment marker is not set, then the header comments are ignored.
625
+
* </p>
626
+
* <p>
627
+
* For example:
628
+
* </p>
629
+
* <pre>
630
+
* builder.setCommentMarker('#')
631
+
* .setHeaderComments("Generated by Apache Commons CSV", Instant.ofEpochMilli(0).toString());
632
+
* </pre>
633
+
* <p>
634
+
* writes:
635
+
* </p>
541
636
* <pre>
542
-
* Builder.setHeaderComments("Generated by Apache Commons CSV.", Instant.now());
637
+
* # Generated by Apache Commons CSV.
638
+
* # 1970-01-01T00:00:00Z
543
639
* </pre>
544
640
*
545
-
* @param headerComments the headerComments which will be printed by the Printer before the actual CSV data.
641
+
* @param headerComments the headerComments which will be printed by the Printer before the CSV data.
0 commit comments