Re: [csv] API design

2011-11-29 Thread James Carman
It really sounds like csv should just be a format that's plugged into another library. On Nov 29, 2011 9:29 AM, "Emmanuel Bourg" wrote: > Le 29/11/2011 14:43, Matt Benson a écrit : > > Well, assuming "header-free" CSV output you could do any odd thing like: >> >> foo;bar;(2);element1;element2; >

Re: [csv] API design

2011-11-29 Thread Adrian Crum
On 11/29/2011 2:26 PM, Emmanuel Bourg wrote: Le 29/11/2011 14:43, Matt Benson a écrit : Well, assuming "header-free" CSV output you could do any odd thing like: foo;bar;(2);element1;element2; giving an open-ended format. Not saying such would be the greatest idea, but could be usable under t

Re: [csv] API design

2011-11-29 Thread Emmanuel Bourg
Le 29/11/2011 14:43, Matt Benson a écrit : Well, assuming "header-free" CSV output you could do any odd thing like: foo;bar;(2);element1;element2; giving an open-ended format. Not saying such would be the greatest idea, but could be usable under the right circumstances. Alternatively, one cou

Re: [csv] API design

2011-11-29 Thread Matt Benson
On Tue, Nov 29, 2011 at 2:34 AM, Emmanuel Bourg wrote: > Le 28/11/2011 21:33, Erhan Bagdemir a écrit : > >> Apache JCA >> Java CSV API :-) >> It is a very cool approach to use annotations for mapping CSV fields with >> beans. >> >> It can be even configured using a class annotation like this: >> @

Re: [csv] API design

2011-11-29 Thread Emmanuel Bourg
Le 28/11/2011 21:33, Erhan Bagdemir a écrit : Apache JCA Java CSV API :-) It is a very cool approach to use annotations for mapping CSV fields with beans. It can be even configured using a class annotation like this: @CSVEntity(seperator= COMMA, quotas=true|false,... ) public class Person {

Re: [csv] API design

2011-11-28 Thread Erhan Bagdemir
We do need rewrite rfc4180 which seemed to me always a little too short. Am 29.11.2011 um 00:05 schrieb Matt Benson: > On Mon, Nov 28, 2011 at 4:55 PM, Erhan Bagdemir > wrote: >> I meant the Collection members of beans. >> I think that it won't be so easy to >> hold a complex data structure

Re: [csv] API design

2011-11-28 Thread Matt Benson
On Mon, Nov 28, 2011 at 4:55 PM, Erhan Bagdemir wrote: > I meant the Collection members of beans. > I think that it won't be so easy to > hold a complex data structure in human-readable form in a "singe" csv file. This doesn't seem different from what I proposed. Difficult != impossible. Matt

Re: [csv] API design

2011-11-28 Thread Erhan Bagdemir
I meant the Collection members of beans. I think that it won't be so easy to hold a complex data structure in human-readable form in a "singe" csv file. Am 28.11.2011 um 22:28 schrieb Simone Tripodi: > What do you mean by collections? A single collection of CSV annotated > elements, or inner

Re: [csv] API design

2011-11-28 Thread Matt Benson
On Mon, Nov 28, 2011 at 3:28 PM, Simone Tripodi wrote: > What do you mean by collections? A single collection of CSV annotated > elements, or inner collection of a CSV annotated element? > I have doubts on option #2, I would expect that any CSV record is > mapped to a single Java POJO... or not?

Re: [csv] API design

2011-11-28 Thread Simone Tripodi
What do you mean by collections? A single collection of CSV annotated elements, or inner collection of a CSV annotated element? I have doubts on option #2, I would expect that any CSV record is mapped to a single Java POJO... or not? Simo http://people.apache.org/~simonetripodi/ http://simonetripo

Re: [csv] API design

2011-11-28 Thread Erhan Bagdemir
Apache JCA Java CSV API :-) It is a very cool approach to use annotations for mapping CSV fields with beans. It can be even configured using a class annotation like this: @CSVEntity(seperator= COMMA, quotas=true|false,... ) public class Person { @CSVField(header="NAME", width=15) } B

Re: [csv] API design

2011-11-28 Thread Simone Tripodi
Hi all, I like the idea of having annotations, and here in CVS you are proposing IMHO a very good approach. If you need some support, as mentioned by Matt, I already deeply explored Annotations analysis at runtime, have a look at[1] @Matt: you reminded me an old idea I had about opening the digest

Re: [csv] API design

2011-11-28 Thread Matt Benson
On Fri, Nov 11, 2011 at 12:50 PM, Emmanuel Bourg wrote: [SNIP] > > The other idea relates to the bean mapping feature. CSVFormat could be > generified and work on annotated classes. I imagine something like this: > >    public class Person { >        @CSVField(trim = true) >        private String

Re: [csv] API design

2011-11-11 Thread Dave Brosius
+1altho, i'd think that @CSVField(trim = true) would often want to be applied at the class level, so many the name isn't so good @CSVOptions ? - Original Message -From: "Emmanuel Bourg" >;ebo...@apache.org