Class IteratorItemReader<T>
java.lang.Object
org.springframework.batch.item.support.IteratorItemReader<T>
- All Implemented Interfaces:
ItemReader<T>
- Author:
- Juliusz Brzostek, Dave Syer, Mahmoud Ben Hassine
-
Constructor Summary
ConstructorsConstructorDescriptionIteratorItemReader(Iterable<T> iterable) Construct a new reader from this iterable (could be a collection), by extracting an instance ofIteratorfrom it.IteratorItemReader(Iterator<T> iterator) Construct a new reader from this iterator directly. -
Method Summary
Modifier and TypeMethodDescriptionread()Implementation ofItemReader.read()that just iterates over the iterator provided.
-
Constructor Details
-
IteratorItemReader
Construct a new reader from this iterable (could be a collection), by extracting an instance ofIteratorfrom it.- Parameters:
iterable- in instance ofIterable- See Also:
-
IteratorItemReader
Construct a new reader from this iterator directly.- Parameters:
iterator- an instance ofIterator
-
-
Method Details
-
read
Implementation ofItemReader.read()that just iterates over the iterator provided.- Specified by:
readin interfaceItemReader<T>- Returns:
- T the item to be processed or
nullif the data source is exhausted
-