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
This commit is contained in:
Gary D. Gregory 2012-10-14 05:08:47 +00:00
parent 17139b840f
commit 0dbb499888
2 changed files with 3 additions and 3 deletions

View File

@ -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('>');
}

View File

@ -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);