Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to search all references of a method ?
How to search all references of a method ? [message #1792319] Mon, 16 July 2018 06:14 Go to next message
Federer Roger  is currently offline Federer Roger Friend
Messages: 19
Registered: December 2017
Junior Member
I want to know the principle of finding the references of an ASTNode. I find a class in org.eclipse.jdt.ui
named LinkedNodeFinder.

public static SimpleName[] findByBinding(ASTNode root, IBinding binding) {
ArrayList<SimpleName> res= new ArrayList<>();
BindingFinder nodeFinder= new BindingFinder(binding, res);
root.accept(nodeFinder);
return res.toArray(new SimpleName[res.size()]);
}

The code use visitor pattern to check each binding within root node. However, I am confused how to find all references
in a whole project? Check the target binding for each CompilationUnit?? Where can I find relative code or anyone give me
some tips?
Re: How to search all references of a method ? [message #1793174 is a reply to message #1792319] Tue, 31 July 2018 22:31 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 3302
Registered: July 2009
Senior Member

For that sort of thing, use the Search engine. http://help.eclipse.org/photon/topic/org.eclipse.jdt.doc.isv/guide/jdt_api_search.htm?cp=3_0_0_4

Nitin Dahyabhai
Eclipse Web Tools Platform
Re: How to search all references of a method ? [message #1793994 is a reply to message #1793174] Wed, 22 August 2018 05:37 Go to previous message
Federer Roger  is currently offline Federer Roger Friend
Messages: 19
Registered: December 2017
Junior Member
Thanks for your link. So I have to do it using JavaModel instead of using jdt.core.dom.ASTNode series?
Previous Topic:Jar Files In Referenced Libraries Of A Project Across Computers
Next Topic:Missing artifact sun.jdk:tools:jar:LATEST
Goto Forum:
  


Current Time: Mon Nov 19 02:55:32 GMT 2018

Powered by FUDForum. Page generated in 0.01785 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top