org.springframework.batch.sample.domain.trade.internal
Class TradeProcessor

java.lang.Object
  extended by org.springframework.batch.sample.domain.trade.internal.TradeProcessor
All Implemented Interfaces:
ItemProcessor<Trade,Trade>

public class TradeProcessor
extends Object
implements ItemProcessor<Trade,Trade>

Processes the Trade - throwing validation errors if necessary.


Constructor Summary
TradeProcessor()
           
 
Method Summary
 Trade process(Trade item)
          Process the provided item, returning a potentially modified or new item for continued processing.
 void setValidationFailure(int failure)
          Public setter for the the index on which failure should occur.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TradeProcessor

public TradeProcessor()
Method Detail

setValidationFailure

public void setValidationFailure(int failure)
Public setter for the the index on which failure should occur.

Parameters:
failure - the failure to set

process

public Trade process(Trade item)
              throws Exception
Description copied from interface: ItemProcessor
Process the provided item, returning a potentially modified or new item for continued processing. If the returned result is null, it is assumed that processing of the item should not continue.

Specified by:
process in interface ItemProcessor<Trade,Trade>
Parameters:
item - to be processed
Returns:
potentially modified or new item for continued processing, null if processing of the provided item should not continue.
Throws:
Exception


Copyright © 2009 SpringSource. All Rights Reserved.