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) } But how will the Collections be handled ? Am 28.11.2011 um 21:14 schrieb 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 digester to > other formats, not just XML... coming soon with a new proposal :) > > Have a nice day, > Simo > > [1] http://commons.apache.org/digester/guide/annotations.html > > http://people.apache.org/~simonetripodi/ > http://simonetripodi.livejournal.com/ > http://twitter.com/simonetripodi > http://www.99soft.org/ > > > > On Mon, Nov 28, 2011 at 6:09 PM, Matt Benson <gudnabr...@gmail.com> wrote: >> On Fri, Nov 11, 2011 at 12:50 PM, Emmanuel Bourg <ebo...@apache.org> 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 firstname; >>> >>> @CSVField(header="NAME", width=12) >>> private String lastname; >>> >>> @CSVField(header="DATE", format="yyyy-MM-dd") >>> private Date birthdate; >>> } >>> >>> then: >>> >>> CSVFormat<Person> format = new CSVFormat().withType(Person.class); >>> >>> for (Person person : format.parse(in)) { >>> .... >>> } >>> >>> >>> What do you think? >> >> These make me think of the annotation support Simo added to >> [digester]. I wonder if there would be any value in extending >> [digester]'s scope to formats beyond XML including CSV/flat files/etc. >> >> Matt >> >>> >>> >>> Emmanuel Bourg >>> >>> >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org >> For additional commands, e-mail: dev-h...@commons.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org