I have row of records which has multiple columns. Different columns could contain values of different types like Long, String, Date etc but one column would have all values of same type. I am trying to write some kind of generic parser which can deal with this. For example If I get different set of records, I should be able to configure my parser.
Input1
1, Jitendra, 2011-02-12
2, Xyz, 2011-02-13
Input2
XYZ, 34.00, 1
ABC, 56.00, 3
Something like this.
Class Parser {
int columnNo;
String columnName;
<Something here to identify data type of column> dataType;
}
Class ParsedRecord{
String name;
<Datatype> value;
}
Does this approach seem to be feasible? Any suggestions?
Thanks