From 0dbb499888e5e17322d08802222f2453bf5621a6 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Sun, 14 Oct 2012 05:08:47 +0000 Subject: [PATCH] Rename "encapsulator" to "quoteChar" so we have quoteChar and quotePolicy. Encapsulator makes me want to ask "encapsulate what"? fieldEncapsulator would be better but so verbose, quoteChar feels more to the point to me and provides symmetry with quotePolicy. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1398016 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/java/org/apache/commons/csv/CSVFormat.java | 4 ++-- src/main/java/org/apache/commons/csv/CSVPrinter.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/csv/CSVFormat.java b/src/main/java/org/apache/commons/csv/CSVFormat.java index 51f1904e..a2f8de61 100644 --- a/src/main/java/org/apache/commons/csv/CSVFormat.java +++ b/src/main/java/org/apache/commons/csv/CSVFormat.java @@ -284,7 +284,7 @@ public class CSVFormat implements Serializable { * * @return {@code true} if an quoteChar is defined */ - public boolean isEncapsulating() { + public boolean isQuoting() { return quoteChar != null; } @@ -547,7 +547,7 @@ public class CSVFormat implements Serializable { sb.append(' '); sb.append("Escape=<").append(escape).append('>'); } - if (isEncapsulating()) { + if (isQuoting()) { sb.append(' '); sb.append("Encapsulator=<").append(quoteChar).append('>'); } diff --git a/src/main/java/org/apache/commons/csv/CSVPrinter.java b/src/main/java/org/apache/commons/csv/CSVPrinter.java index cd7d1487..ba3dac2a 100644 --- a/src/main/java/org/apache/commons/csv/CSVPrinter.java +++ b/src/main/java/org/apache/commons/csv/CSVPrinter.java @@ -135,7 +135,7 @@ public class CSVPrinter { } private void print(final CharSequence value, final int offset, final int len) throws IOException { - if (format.isEncapsulating()) { + if (format.isQuoting()) { printAndEncapsulate(value, offset, len); } else if (format.isEscaping()) { printAndEscape(value, offset, len);