commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Tripodi <simonetrip...@apache.org>
Subject Re: [csv] API design
Date Mon, 28 Nov 2011 20:14:03 GMT
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 <gudnabrsam@gmail.com> wrote:
> On Fri, Nov 11, 2011 at 12:50 PM, Emmanuel Bourg <ebourg@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-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message