|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.core.step.item.SimpleItemHandler
public class SimpleItemHandler
Simplest possible implementation of ItemHandler with no skipping or
recovering. Just delegates all calls to the provided ItemReader and
ItemWriter.
Provides extension points by protected read(StepContribution) and
write(Object, StepContribution) methods that can be overriden to
provide more sophisticated behavior (e.g. skipping).
| Constructor Summary | |
|---|---|
SimpleItemHandler(ItemReader itemReader,
ItemWriter itemWriter)
|
|
| Method Summary | |
|---|---|
void |
clear()
Implementations should delegate to an ItemWriter. |
protected Object |
doRead()
|
protected void |
doWrite(Object item)
|
void |
flush()
Implementations should delegate to an ItemWriter. |
ExitStatus |
handle(StepContribution contribution)
Get the next item from read(StepContribution) and if not null
pass the item to write(Object, StepContribution). |
void |
mark()
Implementations should delegate to an ItemReader. |
protected Object |
read(StepContribution contribution)
|
void |
reset()
Implementations should delegate to an ItemReader. |
protected void |
write(Object item,
StepContribution contribution)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleItemHandler(ItemReader itemReader,
ItemWriter itemWriter)
itemReader - itemWriter - | Method Detail |
|---|
public ExitStatus handle(StepContribution contribution)
throws Exception
read(StepContribution) and if not null
pass the item to write(Object, StepContribution).
handle in interface ItemHandlercontribution - the current step context
ExitStatus indicating whether processing is
continuable.
ExceptionItemHandler.handle(org.springframework.batch.core.StepContribution)
protected Object read(StepContribution contribution)
throws Exception
contribution - current context
Exception
protected final Object doRead()
throws Exception
Exception
protected void write(Object item,
StepContribution contribution)
throws Exception
item - the item to writecontribution - current context
Exception
protected final void doWrite(Object item)
throws Exception
item -
Exception
public void mark()
throws MarkFailedException
ItemHandlerItemReader.
mark in interface ItemHandlerMarkFailedExceptionItemReader.mark()
public void reset()
throws ResetFailedException
ItemHandlerItemReader.
reset in interface ItemHandlerResetFailedExceptionItemReader.reset()
public void clear()
throws ClearFailedException
ItemHandlerItemWriter.
clear in interface ItemHandlerClearFailedExceptionItemWriter.clear()
public void flush()
throws FlushFailedException
ItemHandlerItemWriter.
flush in interface ItemHandlerFlushFailedExceptionItemWriter.flush()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||