I need to know programmatically what classes are calling a given class's (say X) getters and setters. The key thing here is 'programmatically'.
For example, if class A uses X's setPropertyABC() and class B uses X's getPropertyABC(), I would like to define dependency between classes based on their calls to X - in this case, Class A's execution has to precede Class B.
I need to do this programmatically (not through an IDE). I want to create a program that will look at the compiled byte codes or source code of the classes and figure out which classes are using what methods on a given class. What is the best Java library to use for this purpose? Are byte code tools more appropriate? I was thinking if ANTLR can do this job but I am not sure. Is there any sample code in public domain that solves this problem?