Appendix A. List of ItemReaders and ItemWriters

A.1. Item Readers

Table A.1. Available Item Readers

Item ReaderDescription
AbstractItemCountingItemStreamItemReaderAbstract base class that provides basic restart capabilities by counting the number of items returned from an ItemReader.
ListItemReaderProvides the items from a list, one at a time
ItemReaderAdapterAdapts any class to the ItemReader interface.
AggregateItemReaderAn ItemReader that delivers a list as its item, storing up objects from the injected ItemReader until they are ready to be packed out as a collection. This ItemReader should mark the beginning and end of records with the constant values in FieldSetMapper AggregateItemReader#BEGIN_RECORD and AggregateItemReader#END_RECORD
FlatFileItemReaderReads from a flat file. Includes ItemStream and Skippable functionality. See section on Read from a File
StaxEventItemReaderReads via StAX. See HOWTO - Read from a File
JdbcCursorItemReaderReads from a database cursor via JDBC. See HOWTO - Read from a Database
HibernateCursorItemReaderReads from a cursor based on an HQL query. See section on Reading from a Database
IbatisPagingItemReaderReads via iBATIS based on a query. Pages through the rows so that large datasets can be read without running out of memory. See HOWTO - Read from a Database
JmsItemReaderGiven a Spring JmsOperations object and a JMS Destination or destination name to send errors, provides items received through the injected JmsOperations receive() method
JpaPagingItemReaderGiven a JPQL statement, pages through the rows, such that large datasets can be read without running out of memory
JdbcPagingItemReaderGiven a SQL statement, pages through the rows, such that large datasets can be read without running out of memory

A.2. Item Writers

Table A.2. Available Item Writers

Item WriterDescription
AbstractItemStreamItemWriterAbstract base class that combines the ItemStream and ItemWriter interfaces.
CompositeItemWriterPasses an item to the process method of each in an injected List of ItemWriter objects
ItemWriterAdapterAdapts any class to the ItemWriter interface.
PropertyExtractingDelegatingItemWriterExtends AbstractMethodInvokingDelegator creating arguments on the fly. Arguments are created by retrieving the values from the fields in the item to be processed (via a SpringBeanWrapper) based on an injected array of field name
FlatFileItemWriterWrites to a flat file. Includes ItemStream and Skippable functionality. See section on Writing to a File
HibernateItemWriterThis item writer is hibernate session aware and handles some transaction-related work that a non-"hibernate aware" item writer would not need to know about and then delegates to another item writer to do the actual writing.
JdbcBatchItemWriterUses batching features from a PreparedStatement, if available, and can take rudimentary steps to locate a failure during a flush.
JpaItemWriterThis item writer is JPA EntityManager aware and handles some transaction-related work that a non-"jpa aware" ItemWriter would not need to know about and then delegates to another writer to do the actual writing.
StaxEventItemWriterUses an ObjectToXmlSerializer implementation to convert each item to XML and then writes it to an XML file using StAX.