@@ -559,6 +559,17 @@ public String getFirstEndOfLine() {
559559 return lexer .getFirstEol ();
560560 }
561561
562+ /**
563+ * Returns the header comment, if any.
564+ * The header comment appears before the header record.
565+ *
566+ * @return the header comment for this stream, or null if no comment is available.
567+ * @since 1.10.0
568+ */
569+ public String getHeaderComment () {
570+ return headerComment ;
571+ }
572+
562573 /**
563574 * Returns a copy of the header map.
564575 * <p>
@@ -605,57 +616,6 @@ public List<String> getHeaderNames() {
605616 return Collections .unmodifiableList (headers .headerNames );
606617 }
607618
608- /**
609- * Checks whether there is a header comment.
610- * The header comment appears before the header record.
611- * Note that if the parser's format has been given an explicit header
612- * (with {@link CSVFormat.Builder#setHeader(String... )} or another overload)
613- * and the header record is not being skipped
614- * ({@link CSVFormat.Builder#setSkipHeaderRecord} is false) then any initial comments
615- * will be associated with the first record, not the header.
616- *
617- * @return true if this parser has seen a header comment, false otherwise
618- * @since 1.10.0
619- */
620- public boolean hasHeaderComment () {
621- return headerComment != null ;
622- }
623-
624- /**
625- * Returns the header comment, if any.
626- * The header comment appears before the header record.
627- *
628- * @return the header comment for this stream, or null if no comment is available.
629- * @since 1.10.0
630- */
631- public String getHeaderComment () {
632- return headerComment ;
633- }
634-
635- /**
636- * Checks whether there is a trailer comment.
637- * Trailer comments are located between the last record and EOF.
638- * The trailer comments will only be available after the parser has
639- * finished processing this stream.
640- *
641- * @return true if this parser has seen a trailer comment, false otherwise
642- * @since 1.10.0
643- */
644- public boolean hasTrailerComment () {
645- return trailerComment != null ;
646- }
647-
648- /**
649- * Returns the trailer comment, if any.
650- * Trailer comments are located between the last record and EOF
651- *
652- * @return the trailer comment for this stream, or null if no comment is available.
653- * @since 1.10.0
654- */
655- public String getTrailerComment () {
656- return trailerComment ;
657- }
658-
659619 /**
660620 * Returns the current record number in the input stream.
661621 *
@@ -691,6 +651,17 @@ public List<CSVRecord> getRecords() throws IOException {
691651 return records ;
692652 }
693653
654+ /**
655+ * Returns the trailer comment, if any.
656+ * Trailer comments are located between the last record and EOF
657+ *
658+ * @return the trailer comment for this stream, or null if no comment is available.
659+ * @since 1.10.0
660+ */
661+ public String getTrailerComment () {
662+ return trailerComment ;
663+ }
664+
694665 /**
695666 * Handle whether input is parsed as null
696667 *
@@ -710,6 +681,35 @@ private String handleNull(final String input) {
710681 return strictQuoteMode && nullString == null && input .isEmpty () && !isQuoted ? null : input ;
711682 }
712683
684+ /**
685+ * Checks whether there is a header comment.
686+ * The header comment appears before the header record.
687+ * Note that if the parser's format has been given an explicit header
688+ * (with {@link CSVFormat.Builder#setHeader(String... )} or another overload)
689+ * and the header record is not being skipped
690+ * ({@link CSVFormat.Builder#setSkipHeaderRecord} is false) then any initial comments
691+ * will be associated with the first record, not the header.
692+ *
693+ * @return true if this parser has seen a header comment, false otherwise
694+ * @since 1.10.0
695+ */
696+ public boolean hasHeaderComment () {
697+ return headerComment != null ;
698+ }
699+
700+ /**
701+ * Checks whether there is a trailer comment.
702+ * Trailer comments are located between the last record and EOF.
703+ * The trailer comments will only be available after the parser has
704+ * finished processing this stream.
705+ *
706+ * @return true if this parser has seen a trailer comment, false otherwise
707+ * @since 1.10.0
708+ */
709+ public boolean hasTrailerComment () {
710+ return trailerComment != null ;
711+ }
712+
713713 /**
714714 * Tests whether this parser is closed.
715715 *
0 commit comments