Это небольшой пример для этого:
SearchPattern pattern = SearchPattern.createPattern(fTarget.getDeclaringType()
.getFullyQualifiedName()
+ "." + fTarget.getElementName(), type, IJavaSearchConstants.REFERENCES,
SearchPattern.R_PREFIX_MATCH | SearchPattern.R_ERASURE_MATCH);
SearchEngine engine = new SearchEngine();
engine.search(pattern, new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() },
scope, new SearchRequestor() {
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException {
if (match.getAccuracy() == SearchMatch.A_ACCURATE && !match.isInsideDocComment()) {
invocations.add(match);
}
}
}, new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));