T
- Type of item to be readpublic abstract class AbstractPaginatedDataItemReader<T> extends AbstractItemCountingItemStreamItemReader<T>
Modifier and Type | Field and Description |
---|---|
protected int |
page |
protected int |
pageSize |
protected Iterator<T> |
results |
Constructor and Description |
---|
AbstractPaginatedDataItemReader() |
Modifier and Type | Method and Description |
---|---|
protected void |
doClose()
Close the resources opened in
AbstractItemCountingItemStreamItemReader.doOpen() . |
protected void |
doOpen()
Open resources necessary to start reading input.
|
protected abstract Iterator<T> |
doPageRead()
Method this
ItemStreamReader delegates to
for the actual work of reading a page. |
protected T |
doRead()
Read next item from input.
|
protected void |
jumpToItem(int itemLastIndex)
Move to the given item index.
|
void |
setPageSize(int pageSize)
The number of items to be read with each page.
|
close, getCurrentItemCount, isSaveState, open, read, setCurrentItemCount, setMaxItemCount, setSaveState, update
getExecutionContextKey, setExecutionContextName, setName
public void setPageSize(int pageSize)
pageSize
- the number of itemsprotected T doRead() throws Exception
AbstractItemCountingItemStreamItemReader
doRead
in class AbstractItemCountingItemStreamItemReader<T>
Exception
protected abstract Iterator<T> doPageRead()
ItemStreamReader
delegates to
for the actual work of reading a page. Each time
this method is called, the resulting Iterator
should contain the items read within the next page.
Iterator
is empty or null when it is
returned, this ItemReader
will assume that the
input has been exhausted.Iterator
containing the items within a page.protected void doOpen() throws Exception
AbstractItemCountingItemStreamItemReader
doOpen
in class AbstractItemCountingItemStreamItemReader<T>
Exception
protected void doClose() throws Exception
AbstractItemCountingItemStreamItemReader
AbstractItemCountingItemStreamItemReader.doOpen()
.doClose
in class AbstractItemCountingItemStreamItemReader<T>
Exception
protected void jumpToItem(int itemLastIndex) throws Exception
AbstractItemCountingItemStreamItemReader
AbstractItemCountingItemStreamItemReader.doRead()
.jumpToItem
in class AbstractItemCountingItemStreamItemReader<T>
Exception
Copyright © 2014 Pivotal. All rights reserved.