I have been working with Super CSV and i have a doubt how it works with dynamic bean, that to for deep mapping and indexed mapping.
Eg code below
Class Car{
List<Model> carModels = new ArrayList<Model>();// with setters and getters.
}
If my List of car models vary in size then how to handle field mapping and reference XML mapping dynamically without hard coding the index?
Example data
Header/Mapper
name,ip,highAvailability[0].category, highAvailability[0].ip, highAvailability[1].category, highAvailability[1].ip
Values
testNames, 12.18.12.20, Secondary, 12.1.1.1, primary,12.0.10.10 // 1st bean
testNames, 12.18.12.20, Secondary, 12.1.1.1 // 2nd bean
The difference between above bean will that 1st bean has 2 highAvailability objects were the second one has 1 highAvailablity object. Now I do not want to hard code the index since I am unaware of the number of highAvailability objects.