[
https://issues.apache.org/jira/browse/CSV-88?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13241526#comment-13241526
]
Sebb commented on CSV-88:
-------------------------
bq. PRISTINE is useless as a base format because all properties have to be
defined.
No, it's not useless; that's why it was created as empty.
The PRISTINE format provides a base that is untainted by existing settings,
which is why it works well for creating the pre-defined public formats.
The only setting that is absolutely required is the delimiter, which is why I
suggested providing a ctor which takes the delimiter as its only parameter.
As I see it, there are the following possibilities for creating a new basic
format using : as the delimiter.
{code}
fmt1 = new CSVFormat(':');
fmt2 = new CSVFormat().withDelimiter(':');
fmt3 = CSVFormat.PRISTINE.withDelimiter(':');
fmt4 = CSVFormat.newInstance(':');
fmt5 = CSVFormat.newInstance().withDelimiter(':');
{code}
Obviously the constant name PRISTINE can be changed, or the newInstance()
method could be renamed.
> Not possible to create a CSVFormat from scratch
> -----------------------------------------------
>
> Key: CSV-88
> URL: https://issues.apache.org/jira/browse/CSV-88
> Project: Commons CSV
> Issue Type: Bug
> Reporter: Sebb
>
> It's not possible to create a CSVFormat except by modifying an existing
> format.
> Could either make the PRISTINE format public, or provide a constructor with a
> single parameter (the delimiter).
> Could provide a no-args ctor instead, but there seems little point in that.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira