Package org.springframework.batch.item
Interface ItemProcessor<I,O>
- Type Parameters:
I
- type of input itemO
- type of output item
- All Known Implementing Classes:
AsyncItemProcessor
,BeanValidatingItemProcessor
,ClassifierCompositeItemProcessor
,CompositeItemProcessor
,FunctionItemProcessor
,ItemProcessorAdapter
,PassThroughItemProcessor
,ScriptItemProcessor
,ValidatingItemProcessor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface for item transformation. Given an item as input, this interface provides an
extension point which allows for the application of business logic in an item oriented
processing scenario. It should be noted that while it's possible to return a different
type than the one provided, it's not strictly necessary. Furthermore, returning
null
indicates that the item should not be continued to be processed.- Author:
- Robert Kasanicky, Dave Syer, Mahmoud Ben Hassine, Taeik Lim
-
Method Summary
-
Method Details
-
process
Process 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
null
item will never reach this method because the only possible sources are:- an
ItemReader
(which indicates no more items) - a previous
ItemProcessor
in a composite processor (which indicates a filtered item)
- Parameters:
item
- to be processed, nevernull
.- Returns:
- potentially modified or new item for continued processing,
null
if processing of the provided item should not continue. - Throws:
Exception
- thrown if exception occurs during processing.
- an
-