In Java language. Given a root class, I want to find out all the classes referenced by the root(the whole object graph). Java Reflect is not sufficient. Because :
Class A{
List list = new ArrayList();
public void add(Object obj){
list.add(obj);
}
public void add2(){
Ent ent = new Ent();
add(ent);
}
}
Using Reflect, I can easily get "Class A contains (Object)". But actually what I want is “Class A contains (Ent)”.
I want to analyze the java src code or .class file to find out the whole object graph statically, instead of runtime.
Is there anyone can help me ? Thanks!