I am using a spring batch application which reads a Flat file and returns an object . All i wanted to do is to make the FlatFileItemReader to return a list and pass it to processor and so that it treats each list as one item . Please see the snippet below
@Bean public FlatFileItemReader <List<T>> reader() throws Exception {
//reader.read()
}
@Bean
public ItemProcessor <List<T>, V> getTargetValueProcessor() {
return new ItemProcessor <List<T>, V>() {
@Override
public V process(List<T> t) throws Exception {
//processing logic
}
}; }
But my Item processor treats each item in the list as a single input to the processor and the processor is called the number of times as the list size. If the list size returned by the reader is 3 , the processor is called three times. Any thoughts on how to handle list inputs in ItemProcessor ??
TIA