commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <>
Subject [csv] CSVFormat API names
Date Tue, 16 Oct 2012 12:41:43 GMT
Hi All:

The format object can configure various aspects of input and output

With my recent addition of the Quote enum for [CSV-53], there are now two
aspects of quoting to configure: the quote character and the quote policy
(minimal, all, non-numeric, and none.) FYI, 'none' is currently not

First, I changed (without consulting this list, and please accept my
apologies for this) the - IMO - cryptic and burdensome terminology of
"encapsulator" to "quote char", and added "quote policy":

- withQuoteChar(char)
- withQuotePolicy(Quote)

My intention here is that all Quote APIs start with "withQuote" followed by
what aspect of quoting is being configured.

Alternatively, we could have:

- withQuote(char)
- withQuotePolicy(Quote)

Which makes the API more consistent with the other char/Character based

- withEscape
- withDelimiter
- withLineSeparator
- withCommentStart

none of the above are post-fixed with a "Char" in the name.

As far as reading, for me, the "-r" names are OK because the they are nouns
(things): "a delimiter", "a line separator." But I do not talk about "an
escape" because that would be an act (think Alcatraz) as opposed to what we
have here: a character used to /perform/ escapes.

So I propose to change "escape" to "escape char" because "escaper" is not a

The name "comment start" is not great also because it implies (to me) that
there is a "comment end" missing. So plain "comment" or "comment char"
would be better.

Circling back to "quote char" which I have the way it is now for the same
reason as for the "escape" property.

In summary, using *Char names is better IMO.

Discuss! :)


E-Mail: |
JUnit in Action, 2nd Ed: <http://goog_1249600977>
Spring Batch in Action: <>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message