Replace magic char with constant DOUBLE_QUOTE.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1397077 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4efb5ae19a
commit
13092bad7d
|
@ -29,6 +29,8 @@ import java.io.StringWriter;
|
||||||
*/
|
*/
|
||||||
public class CSVFormat implements Serializable {
|
public class CSVFormat implements Serializable {
|
||||||
|
|
||||||
|
private static final char DOUBLE_QUOTE = '"';
|
||||||
|
|
||||||
private static final char COMMA = ',';
|
private static final char COMMA = ',';
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -73,7 +75,7 @@ public class CSVFormat implements Serializable {
|
||||||
public static final CSVFormat DEFAULT =
|
public static final CSVFormat DEFAULT =
|
||||||
PRISTINE.
|
PRISTINE.
|
||||||
withDelimiter(COMMA)
|
withDelimiter(COMMA)
|
||||||
.withEncapsulator('"')
|
.withEncapsulator(DOUBLE_QUOTE)
|
||||||
.withEmptyLinesIgnored(true)
|
.withEmptyLinesIgnored(true)
|
||||||
.withLineSeparator(CRLF);
|
.withLineSeparator(CRLF);
|
||||||
|
|
||||||
|
@ -89,7 +91,7 @@ public class CSVFormat implements Serializable {
|
||||||
public static final CSVFormat RFC4180 =
|
public static final CSVFormat RFC4180 =
|
||||||
PRISTINE.
|
PRISTINE.
|
||||||
withDelimiter(COMMA)
|
withDelimiter(COMMA)
|
||||||
.withEncapsulator('"')
|
.withEncapsulator(DOUBLE_QUOTE)
|
||||||
.withLineSeparator(CRLF);
|
.withLineSeparator(CRLF);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,14 +107,14 @@ public class CSVFormat implements Serializable {
|
||||||
public static final CSVFormat EXCEL =
|
public static final CSVFormat EXCEL =
|
||||||
PRISTINE
|
PRISTINE
|
||||||
.withDelimiter(COMMA)
|
.withDelimiter(COMMA)
|
||||||
.withEncapsulator('"')
|
.withEncapsulator(DOUBLE_QUOTE)
|
||||||
.withLineSeparator(CRLF);
|
.withLineSeparator(CRLF);
|
||||||
|
|
||||||
/** Tab-delimited format, with quote; leading and trailing spaces ignored. */
|
/** Tab-delimited format, with quote; leading and trailing spaces ignored. */
|
||||||
public static final CSVFormat TDF =
|
public static final CSVFormat TDF =
|
||||||
PRISTINE
|
PRISTINE
|
||||||
.withDelimiter('\t')
|
.withDelimiter('\t')
|
||||||
.withEncapsulator('"')
|
.withEncapsulator(DOUBLE_QUOTE)
|
||||||
.withSurroundingSpacesIgnored(true)
|
.withSurroundingSpacesIgnored(true)
|
||||||
.withEmptyLinesIgnored(true)
|
.withEmptyLinesIgnored(true)
|
||||||
.withLineSeparator(CRLF);
|
.withLineSeparator(CRLF);
|
||||||
|
|
Loading…
Reference in New Issue