4
我正在寻找获取调用IMethod的IMethod,IType或IJavaElement。我探索了org.eclipse.jdt.internal.corext.callhierarchy.CallHierarchy。 我已经写了这段代码,但它并没有给我任何包装或位置。 请指导我。通过eclipse获取IMethod的方法调用CallHierarchy
public void getMethodCallers(IMethod[] methods){
CallHierarchy hierarchy = new CallHierarchy();
IJavaSearchScope searchScope= SearchEngine.createWorkspaceScope();
hierarchy.setSearchScope(searchScope);
CallLocation location = hierarchy.getCallLocation(method[0])
MethodWrapper [] wrapper = hierarchy.getCalleeRoots(methods);
}