You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gary Gregory <ga...@gmail.com> on 2013/03/20 06:11:40 UTC

[CSV] org.apache.commons.csv.CSVFormat.DEFAULT

Addressing this TODO:

    /**
     * Standard comma separated format, as for {@link #RFC4180} but
allowing empty lines.
     * <ul>
     * <li>withDelimiter(',')</li>
     * <li>withQuoteChar('"')</li>
     * <li>withIgnoreEmptyLines(true)</li>
     * <li>withLineSeparator(CRLF)</li>
     * </ul>
     */
    public static final CSVFormat DEFAULT = // TODO rename to something
more meaningful
            newBuilder()
            .build();

How about one of:

- RFC4180_WITH_EMPTY_LINES
- RFC4180_EMPTY_LINES
- RFC4180_IGNORE_EMPTY_LINES
- BASIC
- RFC4180_LENIENT
- ?

Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [CSV] org.apache.commons.csv.CSVFormat.DEFAULT

Posted by Gary Gregory <ga...@gmail.com>.
On Wed, Mar 20, 2013 at 3:54 AM, Benedikt Ritter <br...@apache.org> wrote:

> Hi Gary,
>
>
> 2013/3/20 Gary Gregory <ga...@gmail.com>
>
> > Addressing this TODO:
> >
> >     /**
> >      * Standard comma separated format, as for {@link #RFC4180} but
> > allowing empty lines.
> >      * <ul>
> >      * <li>withDelimiter(',')</li>
> >      * <li>withQuoteChar('"')</li>
> >      * <li>withIgnoreEmptyLines(true)</li>
> >      * <li>withLineSeparator(CRLF)</li>
> >      * </ul>
> >      */
> >     public static final CSVFormat DEFAULT = // TODO rename to something
> > more meaningful
> >             newBuilder()
> >             .build();
> >
> > How about one of:
> >
> > - RFC4180_WITH_EMPTY_LINES
> > - RFC4180_EMPTY_LINES
> > - RFC4180_IGNORE_EMPTY_LINES
> > - BASIC
> > - RFC4180_LENIENT
> > - ?
> >
>
> I agree, that the name should contain RFC4180, because the format(builder)
> is derived from the rfc. I would favor RFC4180_EMPTY_LINES, although it is
> pretty long.
>
>
Closing the loop on this one based on a discussion (on a different thread
IIRC), the name stays DEFAULT.

Gary


> Benedikt
>
>
> >
> > Gary
> >
> > --
> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> > Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
> >
>
>
>
> --
> http://people.apache.org/~britter/
> http://www.systemoutprintln.de/
> http://twitter.com/BenediktRitter
> http://github.com/britter
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [CSV] org.apache.commons.csv.CSVFormat.DEFAULT

Posted by Benedikt Ritter <br...@apache.org>.
Hi Gary,


2013/3/20 Gary Gregory <ga...@gmail.com>

> Addressing this TODO:
>
>     /**
>      * Standard comma separated format, as for {@link #RFC4180} but
> allowing empty lines.
>      * <ul>
>      * <li>withDelimiter(',')</li>
>      * <li>withQuoteChar('"')</li>
>      * <li>withIgnoreEmptyLines(true)</li>
>      * <li>withLineSeparator(CRLF)</li>
>      * </ul>
>      */
>     public static final CSVFormat DEFAULT = // TODO rename to something
> more meaningful
>             newBuilder()
>             .build();
>
> How about one of:
>
> - RFC4180_WITH_EMPTY_LINES
> - RFC4180_EMPTY_LINES
> - RFC4180_IGNORE_EMPTY_LINES
> - BASIC
> - RFC4180_LENIENT
> - ?
>

I agree, that the name should contain RFC4180, because the format(builder)
is derived from the rfc. I would favor RFC4180_EMPTY_LINES, although it is
pretty long.

Benedikt


>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter