org.springframework.batch.item.support
Class AggregateItemReader

java.lang.Object
  extended by org.springframework.batch.item.support.AbstractItemReader
      extended by org.springframework.batch.item.support.DelegatingItemReader
          extended by org.springframework.batch.item.support.AggregateItemReader
All Implemented Interfaces:
ItemReader, InitializingBean

public class AggregateItemReader
extends DelegatingItemReader

An ItemReader that delivers a list as its item, storing up objects from the injected ItemReader until they are ready to be packed out as a collection. The ItemReader should mark the beginning and end of records with the constant values in FieldSetMapper (BEGIN_RECORD and END_RECORD).
This class is thread safe (it can be used concurrently by multiple threads) as long as the ItemReader is also thread safe.

Author:
Dave Syer

Field Summary
static Object BEGIN_RECORD
          Marker for the beginning of a multi-object record.
static Object END_RECORD
          Marker for the end of a multi-object record.
 
Constructor Summary
AggregateItemReader()
           
 
Method Summary
 Object read()
          Get the next list of records.
 
Methods inherited from class org.springframework.batch.item.support.DelegatingItemReader
afterPropertiesSet, mark, reset, setItemReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

END_RECORD

public static final Object END_RECORD
Marker for the end of a multi-object record.


BEGIN_RECORD

public static final Object BEGIN_RECORD
Marker for the beginning of a multi-object record.

Constructor Detail

AggregateItemReader

public AggregateItemReader()
Method Detail

read

public Object read()
            throws Exception
Get the next list of records.

Specified by:
read in interface ItemReader
Overrides:
read in class DelegatingItemReader
Throws:
Exception
See Also:
ItemReader.read()


Copyright © 2009 SpringSource. All Rights Reserved.