Using the Search Engine to find an anonymous class [message #534751] |
Thu, 20 May 2010 08:54 |
Chris Messages: 44 Registered: April 2010 |
Member |
|
|
Hi,
I want to find an anonymous class which I know by fully qualified name using the Java Search Engine. I tried the following, but it would not work for anonymous or any "normal" nested type:
SearchPattern pattern = SearchPattern.createPattern(this.fullyQualifiedName, IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH);
IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
SearchRequestor requestor = new TypeSearchRequestor(this);
SearchEngine searchEngine = new SearchEngine();
searchEngine.search(pattern, new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, scope, requestor, null);
The TypeSearchRequestor does not get called in this setup for anonymous and nested classes. The code works fine however for any type, not nested in another.
What am I doing wrong here? Thanks for any insights you can offer.
Regards,
Chris
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03887 seconds