org.springframework.batch.item.transform
Class ItemTransformerItemWriter

java.lang.Object
  extended by org.springframework.batch.item.support.DelegatingItemWriter
      extended by org.springframework.batch.item.transform.ItemTransformerItemWriter
All Implemented Interfaces:
ItemWriter, InitializingBean

public class ItemTransformerItemWriter
extends DelegatingItemWriter

Transforms the item using injected ItemTransformer before it is written to output by ItemWriter.

Author:
Robert Kasanicky

Constructor Summary
ItemTransformerItemWriter()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  Object doProcess(Object item)
          Transform the item using the setItemTransformer(ItemTransformer).
 void setItemTransformer(ItemTransformer itemTransformer)
           
 
Methods inherited from class org.springframework.batch.item.support.DelegatingItemWriter
clear, flush, setDelegate, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemTransformerItemWriter

public ItemTransformerItemWriter()
Method Detail

doProcess

protected Object doProcess(Object item)
                    throws Exception
Transform the item using the setItemTransformer(ItemTransformer).

Overrides:
doProcess in class DelegatingItemWriter
Throws:
Exception

setItemTransformer

public void setItemTransformer(ItemTransformer itemTransformer)
Parameters:
itemTransformer - will transform the item before it is passed to ItemWriter.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class DelegatingItemWriter
Throws:
Exception


Copyright © 2009 SpringSource. All Rights Reserved.