This is the code.
CompilationUnit cu = prepareCompilationUnitForFile(new File("C:\\Test\\src\\Test.java"));
cu.accept(new ASTVisitor()
{
public boolean visit(MethodInvocation v)
{
System.out.println("> " + v);
return true;
}
}
How to:
1) verify the calling object is variable? Like obj.method()
, in this case obj
is calling object
2) get the declaration of obj. Like SomeObject obj = new SomeObject()