Class ListItemWriter<T>

java.lang.Object
org.springframework.batch.item.support.ListItemWriter<T>
All Implemented Interfaces:
ItemWriter<T>

public class ListItemWriter<T> extends Object implements ItemWriter<T>
Item writer that writes items to a List.

This writer is not thread-safe.

Author:
mminella, Mahmoud Ben Hassine
  • Constructor Details

    • ListItemWriter

      public ListItemWriter()
  • Method Details

    • write

      public void write(Chunk<? extends T> chunk) throws Exception
      Description copied from interface: ItemWriter
      Process the supplied data element. Will not be called with any null items in normal operation.
      Specified by:
      write in interface ItemWriter<T>
      Parameters:
      chunk - of items to be written. Must not be null.
      Throws:
      Exception - if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.
    • getWrittenItems

      public List<? extends T> getWrittenItems()