diff --git a/src/main/java/org/apache/commons/csv/CSVFormat.java b/src/main/java/org/apache/commons/csv/CSVFormat.java index b94994640..6c7317f2f 100644 --- a/src/main/java/org/apache/commons/csv/CSVFormat.java +++ b/src/main/java/org/apache/commons/csv/CSVFormat.java @@ -89,9 +89,9 @@ * You can extend a format by calling the {@code set} methods. For example: *

* - *
- * CSVFormat.EXCEL.withNullString("N/A").withIgnoreSurroundingSpaces(true);
- * 
+ *
{@code
+ * CSVFormat.EXCEL.withNullString("N/A").withIgnoreSurroundingSpaces(true);
+ * }
* *

Defining column names

* @@ -99,9 +99,9 @@ * To define the column names you want to use to access records, write: *

* - *
- * CSVFormat.EXCEL.withHeader("Col1", "Col2", "Col3");
- * 
+ *
{@code
+ * CSVFormat.EXCEL.withHeader("Col1", "Col2", "Col3");
+ * }
* *

* Calling {@link Builder#setHeader(String...)} lets you use the given names to address values in a {@link CSVRecord}, and assumes that your CSV source does not @@ -117,10 +117,10 @@ * You can use a format directly to parse a reader. For example, to parse an Excel file with columns header, write: *

* - *
+ * 
{@code
  * Reader in = ...;
- * CSVFormat.EXCEL.withHeader("Col1", "Col2", "Col3").parse(in);
- * 
+ * CSVFormat.EXCEL.withHeader("Col1", "Col2", "Col3").parse(in); + * }
* *

* For other input types, like resources, files, and URLs, use the static methods on {@link CSVParser}. @@ -143,9 +143,9 @@ * Then, call one of the {@link CSVRecord} get method that takes a String column name argument: *

* - *
- * String value = record.get("Col1");
- * 
+ *
{@code
+ * String value = record.get("Col1");
+ * }
* *

* This makes your code impervious to changes in column order in the CSV file. @@ -558,9 +558,9 @@ public Builder setHeader(final ResultSetMetaData resultSetMetaData) throws SQLEx * * or specified manually with: * - *

-         * builder.setHeader("name", "email", "phone");
-         * 
+ *
{@code
+         * builder.setHeader("name", "email", "phone");
+         * }
*

* The header is also used by the {@link CSVPrinter}. *

@@ -2813,9 +2813,9 @@ public CSVFormat withHeader(final ResultSetMetaData resultSetMetaData) throws SQ * * or specified manually with: * - *
-     * CSVFormat format = aformat.withHeader("name", "email", "phone");
-     * 
+ *
{@code
+     * CSVFormat format = aformat.withHeader("name", "email", "phone");
+     * }
*

* The header is also used by the {@link CSVPrinter}. *

@@ -2834,9 +2834,9 @@ public CSVFormat withHeader(final String... header) { * Builds a new {@code CSVFormat} with the header comments of the format set to the given values. The comments will be printed first, before the headers. * This setting is ignored by the parser. * - *
-     * CSVFormat format = aformat.withHeaderComments("Generated by Apache Commons CSV.", Instant.now());
-     * 
+ *
{@code
+     * CSVFormat format = aformat.withHeaderComments("Generated by Apache Commons CSV.", Instant.now());
+     * }
* * @param headerComments the headerComments which will be printed by the Printer before the actual CSV data. * @return A new CSVFormat that is equal to this but with the specified header diff --git a/src/main/java/org/apache/commons/csv/CSVParser.java b/src/main/java/org/apache/commons/csv/CSVParser.java index 626af3874..471a43c12 100644 --- a/src/main/java/org/apache/commons/csv/CSVParser.java +++ b/src/main/java/org/apache/commons/csv/CSVParser.java @@ -82,12 +82,12 @@ * To parse a CSV input from a file, you write: *

* - *
- * File csvData = new File("/path/to/csv");
+ * 
{@code
+ * File csvData = new File("/path/to/csv");
  * CSVParser parser = CSVParser.parse(csvData, CSVFormat.RFC4180);
  * for (CSVRecord csvRecord : parser) {
  *     ...
- * }
+ * }}
  * 
* *

@@ -116,11 +116,11 @@ * If parsing record-wise is not desired, the contents of the input can be read completely into memory. *

* - *
- * Reader in = new StringReader("a;b\nc;d");
+ * 
{@code
+ * Reader in = new StringReader("a;b\nc;d");
  * CSVParser parser = new CSVParser(in, CSVFormat.EXCEL);
- * List<CSVRecord> list = parser.getRecords();
- * 
+ * List list = parser.getRecords(); + * }
* *

* There are two constraints that have to be kept in mind: diff --git a/src/main/java/org/apache/commons/csv/CSVPrinter.java b/src/main/java/org/apache/commons/csv/CSVPrinter.java index 1ca8e4f6f..77ae61a88 100644 --- a/src/main/java/org/apache/commons/csv/CSVPrinter.java +++ b/src/main/java/org/apache/commons/csv/CSVPrinter.java @@ -464,7 +464,7 @@ public void printRecords(final ResultSet resultSet, final boolean printHeader) t * data.add(new String[]{ "A", "B", "C" }); * data.add(new String[]{ "1", "2", "3" }); * data.add(new String[]{ "A1", "B2", "C3" }); - * Stream<String[]> stream = data.stream(); + * Stream stream = data.stream(); * } *

*