2009/1/12 cmoulliard <[email protected]>: > > 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/
