On Mon, Nov 28, 2011 at 3:28 PM, Simone Tripodi
<simonetrip...@apache.org> 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?

I would be in favor of handling collections, etc., mapped to/from the
top-level POJO.  How to execute this might be a little tricky,
however.  However you present the embedded collection in a markup-free
language, you'd presumably need some piece of data to indicate the
collection's boundaries, at least for input.  This type of issue is an
outstanding problem in [flatfile], FWIW.

Matt

> Simo
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
>
>
> On Mon, Nov 28, 2011 at 9:33 PM, Erhan Bagdemir
> <erhan.bagde...@googlemail.com> wrote:
>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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

Reply via email to