concept item processor in category spring

This is an excerpt from Manning's book Spring Batch in Action.
The item processor implemented here is a typical case of using the item processor phase as a filter. The item processor receives valid items from the item reader and decides which items to pass to the item writer. The item processor effectively filters out the other items.
What you need to do now is connect your data access logic with Spring Batch. This is what the item processor in the following listing does.
Listing 7.10. Implementing an item processor to call the DAO
package com.manning.sbia.ch07; import org.springframework.batch.item.ItemProcessor; import com.manning.sbia.ch01.domain.Product; public class IdToProductItemProcessor implements ItemProcessor<String, Product> { private ProductDao productDao; @Override public Product process(String productId) throws Exception { return productDao.load(productId); } public void setProductDao(ProductDao productDao) { this.productDao = productDao; } }The class IdToProductItemProcessor delegates product loading to the product DAO. To avoid writing a dedicated class, you could have used an ItemProcessorAdapter, but with the IdToProductItemProcessor class, the input and output types are easier to picture: String for the IDs returned by the driving query (input), and Product instances loaded by the item processor (output).