类 AggregateItemReader<T>
- java.lang.Object
- org.springframework.batch.sample.domain.multiline.AggregateItemReader<T>
- 所有已实现的接口:
ItemReader<java.util.List<T>>
public class AggregateItemReader<T> extends java.lang.Object implements ItemReader<java.util.List<T>>
AnItemReaderthat delivers a list as its item, storing up objects from the injectedItemReaderuntil they are ready to be packed out as a collection. This class must be used as a wrapper for a customItemReaderthat can identify the record boundaries. The custom reader should mark the beginning and end of records by returning anAggregateItemwhich responds true to its query methodsis*().
This class is thread-safe (it can be used concurrently by multiple threads) as long as theItemReaderis also thread-safe.- 作者:
- Dave Syer
- 另请参阅:
AggregateItem.isHeader(),AggregateItem.isFooter()
构造器概要
构造器 构造器 说明 AggregateItemReader()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 java.util.List<T>read()Get the next list of records.voidsetItemReader(ItemReader<AggregateItem<T>> itemReader)
构造器详细资料
AggregateItemReader
public AggregateItemReader()
方法详细资料
read
public java.util.List<T> read() throws java.lang.Exception
Get the next list of records.- 指定者:
read在接口中ItemReader<T>- 返回:
- T the item to be processed or
nullif the data source is exhausted - 抛出:
ParseException- if there is a problem parsing the current record (but the next one may still be valid)NonTransientResourceException- if there is a fatal exception in the underlying resource. After throwing this exception implementations should endeavour to return null from subsequent calls to read.UnexpectedInputException- if there is an uncategorised problem with the input data. Assume potentially transient, so subsequent calls to read might succeed.java.lang.Exception- if an there is a non-specific error.- 另请参阅:
ItemReader.read()
setItemReader
public void setItemReader(ItemReader<AggregateItem<T>> itemReader)