Class ClassifierCompositeItemProcessor<I,O>
java.lang.Object
org.springframework.batch.item.support.ClassifierCompositeItemProcessor<I,O>
- All Implemented Interfaces:
ItemProcessor<I,
O>
Calls one of a collection of ItemProcessors, based on a router pattern implemented
through the provided
Classifier
.
Note the user is responsible for injecting a Classifier
that returns an
ItemProcessor that conforms to the declared input and output types.- Since:
- 3.0
- Author:
- Jimmy Praet
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDelegates to injectedItemProcessor
instances according to the classification by theClassifier
.void
setClassifier
(org.springframework.classify.Classifier<? super I, ItemProcessor<?, ? extends O>> classifier) Establishes the classifier that will determine whichItemProcessor
to use.
-
Constructor Details
-
ClassifierCompositeItemProcessor
public ClassifierCompositeItemProcessor()
-
-
Method Details
-
setClassifier
public void setClassifier(org.springframework.classify.Classifier<? super I, ItemProcessor<?, ? extends O>> classifier) Establishes the classifier that will determine whichItemProcessor
to use.- Parameters:
classifier
- theClassifier
to set
-
process
Delegates to injectedItemProcessor
instances according to the classification by theClassifier
.- Specified by:
process
in interfaceItemProcessor<I,
O> - 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.
-