public class CompositeItemProcessor<I,O> extends java.lang.Object implements ItemProcessor<I,O>, org.springframework.beans.factory.InitializingBean
ItemProcessor
that passes the item through a sequence of
injected ItemTransformer
s (return value of previous
transformation is the entry value of the next).ItemProcessor
s
that conforms to declared input and output types.Constructor and Description |
---|
CompositeItemProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
O |
process(I item)
Process the provided item, returning a potentially modified or new item for continued
processing.
|
void |
setDelegates(java.util.List<? extends ItemProcessor<?,?>> delegates)
Establishes the
ItemProcessor delegates that will work on the item to be
processed. |
@Nullable public O process(I item) throws java.lang.Exception
ItemProcessor
null
, it is assumed that processing of the item
should not continue.
A null
item will never reach this method because the only possible sources are:
ItemReader
(which indicates no more items)ItemProcessor
in a composite processor (which indicates a filtered item)process
in interface ItemProcessor<I,O>
item
- to be processed, never null
.null
if processing of the
provided item should not continue.java.lang.Exception
- thrown if exception occurs during processing.public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public void setDelegates(java.util.List<? extends ItemProcessor<?,?>> delegates)
ItemProcessor
delegates that will work on the item to be
processed.delegates
- list of ItemProcessor
delegates that will work on the
item.