TheWolf
TheWolf

Reputation: 1695

Retrieving parameter values through reflection

I am trying to come up with a design for a method that takes another method as a parameter and retrieves the parameter values of the method passed. How can this be done? I've tried using java.lang.reflect.* but can't seem to find an API that supports this.

Upvotes: 2

Views: 2478

Answers (2)

Colin Hebert
Colin Hebert

Reputation: 93157

You can't really get the values passed as parameters like this.

You can make your own Proxy and from there capture parameters before calling the right method. Or with aspect you could get the parameters value directly when the method is called.

Upvotes: 5

Related Questions