From db11c04d29dd50f4405c51043b40f0d47d15925d Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Sat, 17 Nov 2012 18:00:38 +0000 Subject: [PATCH] [CSV-68] Use the Builder pattern for CSVFormat. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1410759 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/csv/CSVFormat.java | 165 ++++++++++++++---- .../commons/csv/CSVFormatBuilderTest.java | 24 ++- .../org/apache/commons/csv/CSVFormatTest.java | 150 ++++++++++++++++ 3 files changed, 296 insertions(+), 43 deletions(-) diff --git a/src/main/java/org/apache/commons/csv/CSVFormat.java b/src/main/java/org/apache/commons/csv/CSVFormat.java index d190531d..019e7678 100644 --- a/src/main/java/org/apache/commons/csv/CSVFormat.java +++ b/src/main/java/org/apache/commons/csv/CSVFormat.java @@ -29,12 +29,13 @@ import java.io.IOException; import java.io.Reader; import java.io.Serializable; import java.io.StringWriter; +import java.util.Arrays; /** * The format specification of a CSV file. * * This class is immutable. - * + * * @version $Id$ */ public class CSVFormat implements Serializable { @@ -125,8 +126,8 @@ public class CSVFormat implements Serializable { /** * Creates a new CSV format builds. - * - * @param delimiter + * + * @param delimiter * the char used for value separation, must not be a line break character * @throws IllegalArgumentException if the delimiter is a line break character */ @@ -137,7 +138,7 @@ public class CSVFormat implements Serializable { public static CSVFormatBuilder newBuilder(final CSVFormat format) { return new CSVFormatBuilder(format); } - + /** * Standard comma separated format, as for {@link #RFC4180} but allowing blank lines. *