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
ConstructorDescriptionIteratorItemReader
(Iterable<T> iterable) Construct a new reader from this iterable (could be a collection), by extracting an instance ofIterator
from 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 ofIterator
from 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:
read
in interfaceItemReader<T>
- Returns:
- T the item to be processed or
null
if the data source is exhausted
-