类 KeyValueItemWriter<K,V>
- java.lang.Object
- org.springframework.batch.item.KeyValueItemWriter<K,V>
- 所有已实现的接口:
ItemWriter<V>
,org.springframework.beans.factory.InitializingBean
- 直接已知子类:
GemfireItemWriter
public abstract class KeyValueItemWriter<K,V> extends java.lang.Object implements ItemWriter<V>, org.springframework.beans.factory.InitializingBean
A base class to implement anyItemWriter
that writes to a key value store using aConverter
to derive a key from an item- 从以下版本开始:
- 2.2
- 作者:
- David Turanski
字段概要
字段 修饰符和类型 字段 说明 protected boolean
delete
protected org.springframework.core.convert.converter.Converter<V,K>
itemKeyMapper
构造器概要
构造器 构造器 说明 KeyValueItemWriter()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
protected abstract void
init()
afterPropertiesSet() hookvoid
setDelete(boolean delete)
Sets the delete flag to have the item writer perform deletesvoid
setItemKeyMapper(org.springframework.core.convert.converter.Converter<V,K> itemKeyMapper)
Set theConverter
to use to derive the key from the itemvoid
write(java.util.List<? extends V> items)
Process the supplied data element.protected abstract void
writeKeyValue(K key, V value)
Subclasses implement this method to write each item to key value store
字段详细资料
itemKeyMapper
protected org.springframework.core.convert.converter.Converter<V,K> itemKeyMapper
delete
protected boolean delete
构造器详细资料
KeyValueItemWriter
public KeyValueItemWriter()
方法详细资料
write
public void write(java.util.List<? extends V> items) throws java.lang.Exception
从接口复制的说明:ItemWriter
Process the supplied data element. Will not be called with any null items in normal operation.- 指定者:
write
在接口中ItemWriter<K>
- 参数:
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.
writeKeyValue
protected abstract void writeKeyValue(K key, V value)
Subclasses implement this method to write each item to key value store- 参数:
key
- the keyvalue
- the item
init
protected abstract void init()
afterPropertiesSet() hook
setItemKeyMapper
public void setItemKeyMapper(org.springframework.core.convert.converter.Converter<V,K> itemKeyMapper)
Set theConverter
to use to derive the key from the item- 参数:
itemKeyMapper
- theConverter
used to derive a key from an item.
setDelete
public void setDelete(boolean delete)
Sets the delete flag to have the item writer perform deletes- 参数:
delete
- if trueItemWriter
will perform deletes, if false not to perform deletes.
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- 指定者:
afterPropertiesSet
在接口中org.springframework.beans.factory.InitializingBean
- 抛出:
java.lang.Exception