类 ClassifierCompositeItemWriter<T>
- java.lang.Object
- org.springframework.batch.item.support.ClassifierCompositeItemWriter<T>
- 所有已实现的接口:
ItemWriter<T>
public class ClassifierCompositeItemWriter<T> extends java.lang.Object implements ItemWriter<T>
Calls one of a collection of ItemWriters for each item, based on a router pattern implemented through the providedClassifier
. The implementation is thread-safe if all delegates are thread-safe.- 从以下版本开始:
- 2.0
- 作者:
- Dave Syer, Glenn Renfro
构造器概要
构造器 构造器 说明 ClassifierCompositeItemWriter()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
setClassifier(org.springframework.classify.Classifier<T,ItemWriter<? super T>> classifier)
void
write(java.util.List<? extends T> items)
Delegates to injectedItemWriter
instances according to their classification by theClassifier
.
构造器详细资料
ClassifierCompositeItemWriter
public ClassifierCompositeItemWriter()
方法详细资料
setClassifier
public void setClassifier(org.springframework.classify.Classifier<T,ItemWriter<? super T>> classifier)
- 参数:
classifier
- the classifier to set
write
public void write(java.util.List<? extends T> items) throws java.lang.Exception
Delegates to injectedItemWriter
instances according to their classification by theClassifier
.- 指定者:
write
在接口中ItemWriter<T>
- 参数:
items
- items to be written- 抛出:
java.lang.Exception
- if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.