Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in Reflection

 
Thennam Pandian
Ranch Hand
Posts: 163
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How can I find the Calling Methos using reflection.


thanks,
Thennam
 
Peter Chase
Ranch Hand
Posts: 1970
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think that is done via reflection. Look at the Thread class, for how to get the stack trace.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47262
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean you have a method which wants to know which method has invoked it?

I don't think that you are actually supposed to do that; the idea of a supplier class with public methods is that it is available to all objects without prejudice and without knowing whom it is serving. Bit like a bus; anybody can travel as long as they pay for their ticket, without the driver asking their name!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic