• Post Reply Bookmark Topic Watch Topic
  • New Topic

Access Elements of Reflected ArrayList  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!