title: Spring Batch - Item Reader and ItemProcessor with a list
body: <p>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 </p>
  
  <pre><code>@Bean public FlatFileItemReader &lt;List&lt;T&gt;&gt; reader() throws Exception {
      //reader.read()
      }
  
   @Bean
      public ItemProcessor &lt;List&lt;T&gt;, V&gt; getTargetValueProcessor() {
          return new ItemProcessor &lt;List&lt;T&gt;, V&gt;() {
              @Override
              public V process(List&lt;T&gt; t) throws Exception {
                  //processing logic
              }
          };   }
  </code></pre>
  
  <p>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 ??</p>
  
  <p>TIA</p>