Forums Register Login

Access Elements of Reflected ArrayList

+Pie Number of slices to send: Send
hey there
I have a reflected a class to get a list of it's vars and vals... I've done this with If-statements looping through each var. I can get vals for the other kinds of vars:

The solution to this problem with a String[] was casting it and creating a new String[]... but that didn't work for an ArrayList, maybe because I can't know what kind of Objects are stored in the ArrayList... but I tried casting them as ArrayList<String> and ArrayList<File> but in both cases, no matter which kind of Object the ArrayList really held, neither way worked.. How do I get the elements stored in the ArrayList?
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 488 times.
Similar Threads
Head First Design Patterns - Factory Method Question (?)
Is this good enough?
java.lang.Reflection throwing error when using (String)field.get(new String());
Passing Jave object arrays
Problem in running session beans
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:08:05.