Issue Details (XML | Word | Printable)

Key: BATCH-863
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Lucas Ward
Reporter: Robert Kasanicky
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Batch

introduce LineMapper interface to encapsulate string-to-item mapping

Created: 03/Oct/08 03:39 AM   Updated: 24/Oct/08 04:37 PM
Component/s: Infrastructure
Affects Version/s: 2.0.0.M1
Fix Version/s: 2.0.0.M2

Time Tracking:
Original Estimate: 3d
Original Estimate - 3d
Remaining Estimate: 1.38d
Time Spent - 1.62d Remaining Estimate - 1.38d
Time Spent: 1.62d
Time Spent - 1.62d Remaining Estimate - 1.38d


 Description  « Hide
FlatFileItemReader should not mandate two-phase string-to-item mapping (tokenization + fieldset mapping). Instead it should pass the string and line number to LineMapper which will be responsible for creating a domain object (i.e. LineMapper<T> { T mapLine(String line, int lineNumber)}. Combination LineTokenizer + FieldSetMapper can be used in the default implementation.

Once the change is implemented ResourceLineReader is expected to become redundant.

 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Robert Kasanicky added a comment - 07/Oct/08 04:31 AM
The change is now done. Remaining annoyance is that subversion is unwilling to rename RLR to FFIR although the original FFIR has been removed.

Robert Kasanicky added a comment - 08/Oct/08 04:10 AM
updated customerFilterJob to use DefaultLineMapper

Robert Kasanicky added a comment - 08/Oct/08 04:10 AM
reassigned for review

Lucas Ward added a comment - 09/Oct/08 05:12 PM
I found a small bug when reviewing. The old FFIR threw a FlatFileParseException if an error encountered while trying to tokenize or map a line. This allowed someone to be able to easily skip all parse exceptions, and provided additional information in the case of an error. While it's easier to log out now in the LineMapper, staying consistent with how it worked in 1.1 would be better, and I think provides more options if someone wants to catch the exception directly.