This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-csv.git
commit bea69cd60e3b16a864255f4facf4a2fb00fc8bd3 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sat Sep 14 11:47:16 2024 -0400 Javadoc: Use {@code ...} in pre tags --- .../java/org/apache/commons/csv/CSVFormat.java | 42 +++++++++++----------- .../java/org/apache/commons/csv/CSVParser.java | 14 ++++---- .../java/org/apache/commons/csv/CSVPrinter.java | 2 +- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/main/java/org/apache/commons/csv/CSVFormat.java b/src/main/java/org/apache/commons/csv/CSVFormat.java index b9499464..6c7317f2 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 @@ import org.apache.commons.io.output.AppendableOutputStream; * You can extend a format by calling the {@code set} methods. For example: * </p> * - * <pre> - * CSVFormat.EXCEL.withNullString("N/A").withIgnoreSurroundingSpaces(true); - * </pre> + * <pre>{@code + * CSVFormat.EXCEL.withNullString("N/A").withIgnoreSurroundingSpaces(true); + * }</pre> * * <h2>Defining column names</h2> * @@ -99,9 +99,9 @@ import org.apache.commons.io.output.AppendableOutputStream; * To define the column names you want to use to access records, write: * </p> * - * <pre> - * CSVFormat.EXCEL.withHeader("Col1", "Col2", "Col3"); - * </pre> + * <pre>{@code + * CSVFormat.EXCEL.withHeader("Col1", "Col2", "Col3"); + * }</pre> * * <p> * 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 @@ import org.apache.commons.io.output.AppendableOutputStream; * You can use a format directly to parse a reader. For example, to parse an Excel file with columns header, write: * </p> * - * <pre> + * <pre>{@code * Reader in = ...; - * CSVFormat.EXCEL.withHeader("Col1", "Col2", "Col3").parse(in); - * </pre> + * CSVFormat.EXCEL.withHeader("Col1", "Col2", "Col3").parse(in); + * }</pre> * * <p> * For other input types, like resources, files, and URLs, use the static methods on {@link CSVParser}. @@ -143,9 +143,9 @@ import org.apache.commons.io.output.AppendableOutputStream; * Then, call one of the {@link CSVRecord} get method that takes a String column name argument: * </p> * - * <pre> - * String value = record.get("Col1"); - * </pre> + * <pre>{@code + * String value = record.get("Col1"); + * }</pre> * * <p> * This makes your code impervious to changes in column order in the CSV file. @@ -558,9 +558,9 @@ public final class CSVFormat implements Serializable { * * or specified manually with: * - * <pre> - * builder.setHeader("name", "email", "phone"); - * </pre> + * <pre>{@code + * builder.setHeader("name", "email", "phone"); + * }</pre> * <p> * The header is also used by the {@link CSVPrinter}. * </p> @@ -2813,9 +2813,9 @@ public final class CSVFormat implements Serializable { * * or specified manually with: * - * <pre> - * CSVFormat format = aformat.withHeader("name", "email", "phone"); - * </pre> + * <pre>{@code + * CSVFormat format = aformat.withHeader("name", "email", "phone"); + * }</pre> * <p> * The header is also used by the {@link CSVPrinter}. * </p> @@ -2834,9 +2834,9 @@ public final class CSVFormat implements Serializable { * 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. * - * <pre> - * CSVFormat format = aformat.withHeaderComments("Generated by Apache Commons CSV.", Instant.now()); - * </pre> + * <pre>{@code + * CSVFormat format = aformat.withHeaderComments("Generated by Apache Commons CSV.", Instant.now()); + * }</pre> * * @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 626af387..471a43c1 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 @@ import org.apache.commons.io.function.Uncheck; * To parse a CSV input from a file, you write: * </p> * - * <pre> - * File csvData = new File("/path/to/csv"); + * <pre>{@code + * File csvData = new File("/path/to/csv"); * CSVParser parser = CSVParser.parse(csvData, CSVFormat.RFC4180); * for (CSVRecord csvRecord : parser) { * ... - * } + * }} * </pre> * * <p> @@ -116,11 +116,11 @@ import org.apache.commons.io.function.Uncheck; * If parsing record-wise is not desired, the contents of the input can be read completely into memory. * </p> * - * <pre> - * Reader in = new StringReader("a;b\nc;d"); + * <pre>{@code + * Reader in = new StringReader("a;b\nc;d"); * CSVParser parser = new CSVParser(in, CSVFormat.EXCEL); - * List<CSVRecord> list = parser.getRecords(); - * </pre> + * List<CSVRecord> list = parser.getRecords(); + * }</pre> * * <p> * 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 1ca8e4f6..77ae61a8 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 final class CSVPrinter implements Flushable, Closeable { * 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<String[]> stream = data.stream(); * } * </pre> *