类 ClassifierCompositeItemProcessor<I,O>
- java.lang.Object
- org.springframework.batch.item.support.ClassifierCompositeItemProcessor<I,O>
- 所有已实现的接口:
ItemProcessor<I,O>
public class ClassifierCompositeItemProcessor<I,O> extends java.lang.Object implements ItemProcessor<I,O>
Calls one of a collection of ItemProcessors, based on a router pattern implemented through the providedClassifier. Note the user is responsible for injecting aClassifierthat returns an ItemProcessor that conforms to the declared input and output types.- 从以下版本开始:
- 3.0
- 作者:
- Jimmy Praet
构造器概要
构造器 构造器 说明 ClassifierCompositeItemProcessor()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Oprocess(I item)Delegates to injectedItemProcessorinstances according to the classification by theClassifier.voidsetClassifier(org.springframework.classify.Classifier<? super I,ItemProcessor<?,? extends O>> classifier)Establishes the classifier that will determine whichItemProcessorto use.
构造器详细资料
ClassifierCompositeItemProcessor
public ClassifierCompositeItemProcessor()
方法详细资料
setClassifier
public void setClassifier(org.springframework.classify.Classifier<? super I,ItemProcessor<?,? extends O>> classifier)
Establishes the classifier that will determine whichItemProcessorto use.- 参数:
classifier- theClassifierto set
process
public O process(I item) throws java.lang.Exception
Delegates to injectedItemProcessorinstances according to the classification by theClassifier.- 指定者:
process在接口中ItemProcessor<I,O>- 参数:
item- to be processed- 返回:
- potentially modified or new item for continued processing,
nullif processing of the provided item should not continue. - 抛出:
java.lang.Exception- thrown if exception occurs during processing.