开发者

how to find what hook/method is being called in a framework

开发者 https://www.devze.com 2022-12-22 05:27 出处:网络
I was wondering how should I proceed to debug while working with frameworks. Like specifically how can i tell which method is being called when a particular event happ开发者_如何转开发ens.

I was wondering how should I proceed to debug while working with frameworks. Like specifically how can i tell which method is being called when a particular event happ开发者_如何转开发ens.

thanks raja


There are multiple ways to do this

1) Adding eclipse debug points (as described above)

2) Enable log statements. Most frameworks use logging (log4j, slf4j etc). So write a log4j.xml and create a category for "com.xxx" where all your framework classes have a package structure of com.xxx.yyy or com.xxx.aaa. Set the logging to be debug level and run the program (which uses the framework) analysing the log files should tell you

3) In eclipse if you cant run the program (so option 1 is not really possible) you can do a "Search usage" for an API to get who is using this. This option is however limited by the fact some frameworks use reflection, interfaces etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号