I have come across a problem with my project which I don't know how to get past. I need some way of creating a Java bean object where I can dynamically add as many variables(properties) as I want. I currently have an ArrayList of object which hold the variables:
String name;
boolean enabled;
int id;
I need to loop through this list of Objects and add the boolean value to a single java bean object. For Example: If the ArrayList of Objects were 6, I would end up with a single object with 6 variables of the enabled boolean value. If the list grew, the number of variables will grow in the object.
Is this possible? I need this for a table where each row will get its values from the Java Bean getters, which is why all the boolean values must be in the same object.