Feb 29th, 2012, 11:21 AM
Cannot change DefaultLineMapper delimiter ?
I got the following behaviour which I do not understand :
In the following bean property, the | is never used as a separator thus I get incorrect number of fields exception.
If I remove the constructor-arg, remove the delimiter property and thus use the comma separator, then, the fields are correctly tokenized.
It is as if I was not allowed to change the separator. Is this a bug or did I miss something (more likely) ?
<bean class="org.springframework.batch.item.file.mapping .DefaultLineMapper">
Many thanks !
Feb 29th, 2012, 09:40 PM
The delimiter is only used to tokenize the contents of the file you are reading. The "names" attribute of DelimitedLineTokenizer is a String of column names and you configure this in the application context by seperating the values with commas.
Mar 1st, 2012, 06:17 AM
aah ok !
That is clear enough !
Thank you very much
Tags for this Thread