Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to invoke a method of a reflected field

 
Tudor Raneti
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SOLVED: I figured it out, the key was:


sumsNavigation is of type B that extends type A which has a protected LinkedList components; //field
It isn't possible to extend A directly from my class because of a special setup.
I need to do components.size() basically, but through reflection. I'm stuck at invoking the method, it won't accept any argument in m.invoke(sumsNavigation);.



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic