File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java reflection and List

 
Edward Chen
Ranch Hand
Posts: 798
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I have
java.Util.List<Address> addressList;

how could I use java reflection to get the "Address" info in the above?

Thanks.
 
Keith Lynn
Ranch Hand
Posts: 2399
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean determine what the type parameter was?

Remember that type information is erased by the compiler.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With other words, you couldn't.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic