This is what I came up with to read a file with fixed positions records and parse it contents by using a XML property file. This meta data XML file contains the lower and upper boundary of each field's character positions.
The readFixedLengthFile method of the FixedLengthFileReader class takes the arguments of the input data file and the xml property file. Each line of the input file is read and by using the xml file's field description it is parsed and stored in a HashMap object. This HashMap object is then returned back to the caller.
Here's client application -
The input data file - Test.txt :
XML property file - Test.xml :
The console output from the client run -