org.springframework.batch.item.validator
Class ValidatingItemReader

java.lang.Object
  extended by org.springframework.batch.item.support.AbstractItemReader
      extended by org.springframework.batch.item.support.DelegatingItemReader
          extended by org.springframework.batch.item.validator.ValidatingItemReader
All Implemented Interfaces:
ItemReader, InitializingBean

public class ValidatingItemReader
extends DelegatingItemReader

Simple extension of DelegatingItemReader that provides for validation before returning input.

Author:
Lucas Ward

Constructor Summary
ValidatingItemReader()
           
 
Method Summary
 void afterPropertiesSet()
           
 Object read()
          Get the next object from the input source.
 void setValidator(Validator validator)
          Set the validator used to validate each item.
 
Methods inherited from class org.springframework.batch.item.support.DelegatingItemReader
mark, reset, setItemReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatingItemReader

public ValidatingItemReader()
Method Detail

afterPropertiesSet

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

read

public Object read()
            throws Exception
Description copied from class: DelegatingItemReader
Get the next object from the input source.

Specified by:
read in interface ItemReader
Overrides:
read in class DelegatingItemReader
Throws:
Exception - if an underlying resource is unavailable.
See Also:
ItemReader.read()

setValidator

public void setValidator(Validator validator)
Set the validator used to validate each item.

Parameters:
validator -


Copyright © 2009 SpringSource. All Rights Reserved.