diff --git a/src/main/java/org/apache/commons/csv/CSVFormat.java b/src/main/java/org/apache/commons/csv/CSVFormat.java index 566728a3..3158fcd1 100644 --- a/src/main/java/org/apache/commons/csv/CSVFormat.java +++ b/src/main/java/org/apache/commons/csv/CSVFormat.java @@ -36,7 +36,7 @@ import java.util.Set; /** * Specifies the format of a CSV file and parses input. * - *
* You can use one of the predefined formats: @@ -64,7 +64,7 @@ import java.util.Set; * *
CSVParser parser = CSVFormat.parseFile(file, CSVFormat.EXCEL);* - *
* You can extend a format by calling the {@code with} methods. For example: @@ -76,7 +76,7 @@ import java.util.Set; * .withIgnoreSurroundingSpaces(true); * * - *
* To define the column names you want to use to access records, write: @@ -94,7 +94,7 @@ import java.util.Set; * {@link #withSkipHeaderRecord(boolean)} with {@code true}. *
* - ** You can use a format directly to parse a reader. For example, to parse an Excel file with columns header, write: @@ -109,7 +109,7 @@ import java.util.Set; * For other input types, like resources, files, and URLs, use the static methods on {@link CSVParser}. *
* - ** If your source contains a header record, you can simplify your code and safely reference columns, @@ -134,7 +134,7 @@ import java.util.Set; * This makes your code impervious to changes in column order in the CSV file. *
* - ** This class is immutable. @@ -188,13 +188,18 @@ public final class CSVFormat implements Serializable { /** * Excel file format (using a comma as the value delimiter). Note that the actual value delimiter used by Excel is * locale dependent, it might be necessary to customize this format to accommodate to your regional settings. - *
+ * + ** For example for parsing or generating a CSV file on a French system the following format will be used: + *
* ** CSVFormat fmt = CSVFormat.newBuilder(EXCEL).withDelimiter(';'); *+ * + *
* Settings are: + *
*+ * There are several static factory methods that can be used to create instances for various types of resources: + *
** Alternatively parsers can also be created by passing a {@link Reader} directly to the sole constructor. * @@ -64,7 +64,7 @@ import java.util.NoSuchElementException; * } * * - *
* To parse a CSV input from a file, you write: *
@@ -98,7 +98,7 @@ import java.util.NoSuchElementException; * customising CSVFormats is available in {@link CSVFormat CSVFormat JavaDoc}. * * - ** If parsing record wise is not desired, the contents of the input can be read completely into memory. *
@@ -113,16 +113,14 @@ import java.util.NoSuchElementException; * There are two constraints that have to be kept in mind: * * - **
* Internal parser state is completely covered by the format and the reader-state. *
@@ -268,8 +266,10 @@ public final class CSVParser implements Iterable+ * ATTENTION: If your CSV input has multi-line values, the returned number does not correspond to the record number. + *
* * @return current line number */ @@ -290,8 +290,10 @@ public final class CSVParser implements Iterable+ * ATTENTION: If your CSV input has multi-line values, the returned number does not correspond to the line number. + *
* * @return current line number */ @@ -302,8 +304,10 @@ public final class CSVParser implements Iterable* The returned content starts at the current parse-position in the stream. + *
* * @return list of {@link CSVRecord CSVRecords}, may be empty * @throws IOException @@ -316,11 +320,14 @@ public final class CSVParser implements Iterable* The returned content starts at the current parse-position in the stream. - * + *
+ * * @param records * The collection to add to. + * @param* Currently, only a pure encapsulation format or a pure escaping format is supported. Hybrid formats * (encapsulation and escaping with a different character) are not supported. + *
* * @param out * stream to which to print. Must not be null. @@ -275,10 +276,13 @@ public final class CSVPrinter implements Flushable, Closeable { } /** - * Prints a comment on a new line among the delimiter separated values. Comments will always begin on a new line - * and occupy a least one full line. The character specified to start comments and a space will be inserted at the - * beginning of each new line in the comment. - * + * Prints a comment on a new line among the delimiter separated values. + * + *+ * Comments will always begin on a new line and occupy a least one full line. The character specified to start + * comments and a space will be inserted at the beginning of each new line in the comment. + *
+ * * If comments are disabled in the current CSV format this method does nothing. * * @param comment