Reputation: 676
I am writing a batch application which reads line-by-line from a file, process the content and write to database. Am using FlatFileItemReader
for reading from file.
The first line in the file is special (header) which is skipped using linesToSkip and processed using a LineCallbackHandler
(HeaderHandler
). The HeaderHandler
builds a cache using the header information.
Now I want to make use of this cache within my ItemWriter
. Am not sure how to pass the cache object I build within HeaderHandler
to my ItemWriter
. Is there a clean way of doing this?
Upvotes: 2
Views: 2630
Reputation: 6630
you have at least 2 possibilities:
Upvotes: 2