Class CompositeItemProcessor<I,O>
java.lang.Object
org.springframework.batch.item.support.CompositeItemProcessor<I,O>
- All Implemented Interfaces:
ItemProcessor<I,,O> org.springframework.beans.factory.InitializingBean
public class CompositeItemProcessor<I,O>
extends Object
implements ItemProcessor<I,O>, org.springframework.beans.factory.InitializingBean
Composite
Note the user is responsible for injecting a chain of
ItemProcessor that passes the item through a sequence of injected
ItemTransformers (return value of previous transformation is the entry
value of the next).Note the user is responsible for injecting a chain of
ItemProcessors that
conforms to declared input and output types.- Author:
- Robert Kasanicky
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorCompositeItemProcessor(List<? extends ItemProcessor<?, ?>> delegates) Convenience constructor for setting the delegates.CompositeItemProcessor(ItemProcessor<?, ?>... delegates) Convenience constructor for setting the delegates. -
Method Summary
Modifier and TypeMethodDescriptionvoidProcess the provided item, returning a potentially modified or new item for continued processing.voidsetDelegates(List<? extends ItemProcessor<?, ?>> delegates) Establishes theItemProcessordelegates that will work on the item to be processed.
-
Constructor Details
-
CompositeItemProcessor
public CompositeItemProcessor()Default constructor -
CompositeItemProcessor
Convenience constructor for setting the delegates.- Parameters:
delegates- array ofItemProcessordelegates that will work on the item.
-
CompositeItemProcessor
Convenience constructor for setting the delegates.- Parameters:
delegates- list ofItemProcessordelegates that will work on the item.
-
-
Method Details
-
process
Description copied from interface:ItemProcessorProcess the provided item, returning a potentially modified or new item for continued processing. If the returned result isnull, it is assumed that processing of the item should not continue.A
nullitem will never reach this method because the only possible sources are:- an
ItemReader(which indicates no more items) - a previous
ItemProcessorin a composite processor (which indicates a filtered item)
- Specified by:
processin interfaceItemProcessor<I,O> - Parameters:
item- to be processed, nevernull.- Returns:
- potentially modified or new item for continued processing,
nullif processing of the provided item should not continue. - Throws:
Exception- thrown if exception occurs during processing.
- an
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
setDelegates
Establishes theItemProcessordelegates that will work on the item to be processed.- Parameters:
delegates- list ofItemProcessordelegates that will work on the item.
-