camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" <claus.ib...@gmail.com>
Subject Re: Advise on @Annotation & Reflection !!
Date Mon, 12 Jan 2009 16:37:01 GMT
Yeah I think you should avoid being dependent on any of the existing
code (the CSV stuff, that is).

On Mon, Jan 12, 2009 at 5:34 PM, James Strachan
<james.strachan@gmail.com> wrote:
> 2009/1/12 cmoulliard <cmoulliard@gmail.com>:
>>
>> Question :
>>
>> Do I have to reuse the code of the CSVDataFormat class in the unmarshall
>> method in order to extract from the file each CSV record  like this ?
>>
>>        InputStreamReader in = new InputStreamReader(inputStream);
>>        try {
>>            CSVParser parser = new CSVParser(in, getStrategy());
>>            List<List<String>> list = new ArrayList<List<String>>();
>>            while (true) {
>>                String[] strings = parser.getLine();
>>
>> Remark : the issue is that through my annotation I define the field
>> 'separator' and parser will split the content according to what is define in
>> the strategy
>>
>> OR my code must be independent of org.apache.commons.csv classes ?
>
> Whichever is easiest for you really. Feel free to reuse
> org.apache.commons.csv if it makes sense to do so - though feel free
> to avoid it. Same on the CSVDataFormat
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://fusesource.com/
>



-- 

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/

Mime
View raw message