Re: [CSV] Creating CSVParser instances

2013-08-29 Thread Benedikt Ritter
2013/8/14 Adrian Crum > > On 8/14/2013 1:10 PM, Emmanuel Bourg wrote: > >> Le 14/08/2013 20:09, Benedikt Ritter a écrit : >> >> Every factory method an the constructor now take a CSVFormat. How about >>> using CSVFormat.DEFAULT is null is passed as CSVFormat? >>> >> >> Keeping null is better, us

Re: [CSV] Creating CSVParser instances

2013-08-14 Thread Adrian Crum
On 8/14/2013 1:10 PM, Emmanuel Bourg wrote: Le 14/08/2013 20:09, Benedikt Ritter a écrit : Every factory method an the constructor now take a CSVFormat. How about using CSVFormat.DEFAULT is null is passed as CSVFormat? Keeping null is better, using the default format might hide a bug in the

Re: [CSV] Creating CSVParser instances

2013-08-14 Thread Emmanuel Bourg
Le 14/08/2013 20:09, Benedikt Ritter a écrit : Every factory method an the constructor now take a CSVFormat. How about using CSVFormat.DEFAULT is null is passed as CSVFormat? Keeping null is better, using the default format might hide a bug in the calling code, and it could be difficult to fi

Re: [CSV] Creating CSVParser instances

2013-08-14 Thread Gary Gregory
On Wed, Aug 14, 2013 at 2:09 PM, Benedikt Ritter wrote: > Done in revision 1513994. > > Every factory method an the constructor now take a CSVFormat. How about > using CSVFormat.DEFAULT is null is passed as CSVFormat? > Seems reasonable. Gary > > Benedikt > > > 2013/8/14 Matt Benson > > > To

Re: [CSV] Creating CSVParser instances

2013-08-14 Thread Benedikt Ritter
Done in revision 1513994. Every factory method an the constructor now take a CSVFormat. How about using CSVFormat.DEFAULT is null is passed as CSVFormat? Benedikt 2013/8/14 Matt Benson > To stir the pot, one might even make a case for using Reader only ;-) . > > Matt > On Aug 14, 2013 8:03 AM

Re: [CSV] Creating CSVParser instances

2013-08-14 Thread Matt Benson
To stir the pot, one might even make a case for using Reader only ;-) . Matt On Aug 14, 2013 8:03 AM, "Gary Gregory" wrote: > On Wed, Aug 14, 2013 at 2:44 AM, Benedikt Ritter > wrote: > > > 2013/8/12 Gary Gregory > > > > > On Mon, Aug 12, 2013 at 3:13 PM, Benedikt Ritter > > > wrote: > > > >

Re: [CSV] Creating CSVParser instances

2013-08-14 Thread Gary Gregory
On Wed, Aug 14, 2013 at 2:44 AM, Benedikt Ritter wrote: > 2013/8/12 Gary Gregory > > > On Mon, Aug 12, 2013 at 3:13 PM, Benedikt Ritter > > wrote: > > > > > 2013/8/8 Gary Gregory > > > > > > > On Thu, Aug 8, 2013 at 10:27 AM, Benedikt Ritter > > > > > wrote: > > > > > > > > > 2013/8/8 Emmanue

Re: [CSV] Creating CSVParser instances

2013-08-14 Thread sebb
On 14 August 2013 07:44, Benedikt Ritter wrote: > 2013/8/12 Gary Gregory > >> On Mon, Aug 12, 2013 at 3:13 PM, Benedikt Ritter >> wrote: >> >> > 2013/8/8 Gary Gregory >> > >> > > On Thu, Aug 8, 2013 at 10:27 AM, Benedikt Ritter >> > > wrote: >> > > >> > > > 2013/8/8 Emmanuel Bourg >> > > > >>

Re: [CSV] Creating CSVParser instances

2013-08-13 Thread Benedikt Ritter
2013/8/12 Gary Gregory > On Mon, Aug 12, 2013 at 3:13 PM, Benedikt Ritter > wrote: > > > 2013/8/8 Gary Gregory > > > > > On Thu, Aug 8, 2013 at 10:27 AM, Benedikt Ritter > > > wrote: > > > > > > > 2013/8/8 Emmanuel Bourg > > > > > > > > > Le 08/08/2013 15:40, Gary Gregory a écrit : > > > > >

Re: [CSV] Creating CSVParser instances

2013-08-12 Thread Gary Gregory
On Mon, Aug 12, 2013 at 3:13 PM, Benedikt Ritter wrote: > 2013/8/8 Gary Gregory > > > On Thu, Aug 8, 2013 at 10:27 AM, Benedikt Ritter > > wrote: > > > > > 2013/8/8 Emmanuel Bourg > > > > > > > Le 08/08/2013 15:40, Gary Gregory a écrit : > > > > > > > > > Sans type names: > > > > > > > > > > p

Re: [CSV] Creating CSVParser instances

2013-08-12 Thread Benedikt Ritter
2013/8/8 Gary Gregory > On Thu, Aug 8, 2013 at 10:27 AM, Benedikt Ritter > wrote: > > > 2013/8/8 Emmanuel Bourg > > > > > Le 08/08/2013 15:40, Gary Gregory a écrit : > > > > > > > Sans type names: > > > > > > > > parse(File, CSVFormat) > > > > parse(String, Charset, ClassLoader, CSVFormat) > >

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Gary Gregory
On Thu, Aug 8, 2013 at 10:27 AM, Benedikt Ritter wrote: > 2013/8/8 Emmanuel Bourg > > > Le 08/08/2013 15:40, Gary Gregory a écrit : > > > > > Sans type names: > > > > > > parse(File, CSVFormat) > > > parse(String, Charset, ClassLoader, CSVFormat) > > > parse(String, Charset, CSVFormat) > > > [pa

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Gary Gregory
On Thu, Aug 8, 2013 at 10:09 AM, Emmanuel Bourg wrote: > Le 08/08/2013 15:40, Gary Gregory a écrit : > > > Sans type names: > > > > parse(File, CSVFormat) > > parse(String, Charset, ClassLoader, CSVFormat) > > parse(String, Charset, CSVFormat) > > [parse(String)] > > parse(String, CSVFormat) > >

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Gary Gregory
On Thu, Aug 8, 2013 at 10:09 AM, Emmanuel Bourg wrote: > Le 08/08/2013 15:40, Gary Gregory a écrit : > > > Sans type names: > > > > parse(File, CSVFormat) > > parse(String, Charset, ClassLoader, CSVFormat) > > parse(String, Charset, CSVFormat) > > [parse(String)] > > parse(String, CSVFormat) > >

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Bernd Eckenfels
Am 08.08.2013, 16:09 Uhr, schrieb Emmanuel Bourg : Le 08/08/2013 15:40, Gary Gregory a écrit : Sans type names: parse(File, CSVFormat) parse(String, Charset, ClassLoader, CSVFormat) parse(String, Charset, CSVFormat) [parse(String)] parse(String, CSVFormat) parse(URL, Charset, CSVFormat) That

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Emmanuel Bourg
Le 08/08/2013 16:43, Benedikt Ritter a écrit : > Damn it, Emmanuel is always against me ;-) I love everyone :) I'm just against unnecessary complexity. > Okay then: leave it as it is, but move factory methods from CSVParser to > CSVFormat? I'd support that. It's no longer factory methods at th

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Adrian Crum
+1 for createParser(...) -Adrian On 8/8/2013 6:14 AM, Gary Gregory wrote: On Thu, Aug 8, 2013 at 5:30 AM, Emmanuel Bourg wrote: Thank you for pointing this, I didn't notice this recent addition. I'm not fond of the parseType(Type t) methods, I'd prefer parse(Type t). I'm OK with 'parse' o

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Benedikt Ritter
2013/8/8 Emmanuel Bourg > Le 08/08/2013 16:27, Benedikt Ritter a écrit : > > > A format can parse something... That sounds strange to me. > > That's pretty common though. NumberFormat, DateFormat are good examples. > > > > Let's rename it to > > > >format.createParser(file) > > Please, no :)

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Emmanuel Bourg
Le 08/08/2013 16:27, Benedikt Ritter a écrit : > A format can parse something... That sounds strange to me. That's pretty common though. NumberFormat, DateFormat are good examples. > Let's rename it to > >format.createParser(file) Please, no :) Emmanuel ---

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Benedikt Ritter
2013/8/8 Emmanuel Bourg > Le 08/08/2013 15:40, Gary Gregory a écrit : > > > Sans type names: > > > > parse(File, CSVFormat) > > parse(String, Charset, ClassLoader, CSVFormat) > > parse(String, Charset, CSVFormat) > > [parse(String)] > > parse(String, CSVFormat) > > parse(URL, Charset, CSVFormat)

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Emmanuel Bourg
Le 08/08/2013 15:40, Gary Gregory a écrit : > Sans type names: > > parse(File, CSVFormat) > parse(String, Charset, ClassLoader, CSVFormat) > parse(String, Charset, CSVFormat) > [parse(String)] > parse(String, CSVFormat) > parse(URL, Charset, CSVFormat) That looks better. I would remove the metho

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Emmanuel Bourg
Le 08/08/2013 15:10, Gary Gregory a écrit : > The one instance factory method in CSVFormat is a convenience that I do not > find useful, it just makes for a nice demo _in theory_. In my experience, I > always create utility methods to create Readers from different sources. I > would be OK removing

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Gary Gregory
On Thu, Aug 8, 2013 at 9:14 AM, Gary Gregory wrote: > On Thu, Aug 8, 2013 at 5:30 AM, Emmanuel Bourg wrote: > >> Thank you for pointing this, I didn't notice this recent addition. >> >> I'm not fond of the parseType(Type t) methods, I'd prefer parse(Type t). >> > > I'm OK with 'parse' or 'create

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Gary Gregory
On Thu, Aug 8, 2013 at 9:10 AM, Gary Gregory wrote: > On Thu, Aug 8, 2013 at 4:24 AM, Benedikt Ritter wrote: > >> Hi, >> >> we currently have several static factory methods in CSVParser: >> >> - public static CSVParser parseFile(File file, final CSVFormat format) >> throws IOException >> - public

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Gary Gregory
On Thu, Aug 8, 2013 at 5:30 AM, Emmanuel Bourg wrote: > Thank you for pointing this, I didn't notice this recent addition. > > I'm not fond of the parseType(Type t) methods, I'd prefer parse(Type t). > I'm OK with 'parse' or 'createParser'. WRT to types, the only time the type name is really nee

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Gary Gregory
On Thu, Aug 8, 2013 at 4:24 AM, Benedikt Ritter wrote: > Hi, > > we currently have several static factory methods in CSVParser: > > - public static CSVParser parseFile(File file, final CSVFormat format) > throws IOException > - public static CSVParser parseResource(String resource, Charset charse

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Emmanuel Bourg
Le 08/08/2013 14:25, Benedikt Ritter a écrit : > Anyway we would still have the problems I outline: > - the same CSVParser can be created in different ways (via contructor and > via CSVFormat.parse(Reader)). And from CSVFormat.parse() > - parse methods don't actually parse. They just create pars

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Benedikt Ritter
2013/8/8 Emmanuel Bourg > Thank you for pointing this, I didn't notice this recent addition. > > I'm not fond of the parseType(Type t) methods, I'd prefer parse(Type t). > Different method names make sense for parseResource(String, Charset, ClassLoader, CSVFormat) and parseString(String). One ca

Re: [CSV] Creating CSVParser instances

2013-08-08 Thread Emmanuel Bourg
Thank you for pointing this, I didn't notice this recent addition. I'm not fond of the parseType(Type t) methods, I'd prefer parse(Type t). Btw I would have kept these methods out of csv 1.0, this is again delaying the release with another discussion... Emmanuel Bourg Le 08/08/2013 10:24, Bene

[CSV] Creating CSVParser instances

2013-08-08 Thread Benedikt Ritter
Hi, we currently have several static factory methods in CSVParser: - public static CSVParser parseFile(File file, final CSVFormat format) throws IOException - public static CSVParser parseResource(String resource, Charset charset, ClassLoader classLoader, final CSVFormat format) throw