Jul 17th, 2012, 08:56 AM
FlatFileItemReader with optional data
I've implemented a FlatFileItemReader that needs to read a file which contains optional data. For example, my data file contains firstName, middleInitial and lastName. A value for middleInitial is not always present. When I call fieldset.readChar("middleInitial") and a value is , I get this error: java.lang.IllegalArgumentException: Cannot convert field value '' to char.
What's the best way to handle 'optional data' in a fixed length file?