Searches for the Java element determined by the given signature. The signature can be incomplete. For example, a call like
search(ws, "run()", METHOD,REFERENCES, col)
searches for all references to the method
run
. Note that by default the pattern will be case insensitive. For specifying case s sensitive search, use
search(workspace, createSearchPattern(patternString, searchFor, limitTo, true), scope, resultCollector);
@param workspace the workspace
@param patternString the pattern to be searched for
@param searchFor a hint what kind of Java element the string pattern represents.Look into {@link IJavaSearchConstants} for valid values
@param limitTo one of the following values:
- {@link IJavaSearchConstants#DECLARATIONS}: search for declarations only
- {@link IJavaSearchConstants#REFERENCES}: search for all references
- {@link IJavaSearchConstants#ALL_OCCURRENCES}: search for both declarations and all references
- {@link IJavaSearchConstants#IMPLEMENTORS}: for types, will find all types which directly implement/extend a given interface.
Note that types may be only classes or only interfaces if respectively {@link IJavaSearchConstants#CLASS} or{@link IJavaSearchConstants#INTERFACE} is used for searchFor parameter instead of {@link IJavaSearchConstants#TYPE}.
@param scope the search result has to be limited to the given scope
@param resultCollector a callback object to which each match is reported
@exception JavaModelException if the search failed. Reasons include:
- the classpath is incorrectly set
@deprecated Use {@link #search(SearchPattern,SearchParticipant[],IJavaSearchScope,SearchRequestor,IProgressMonitor)} instead.