org.aspectj.org.eclipse.jdt.internal.core.search
Class BasicSearchEngine

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.core.search.BasicSearchEngine

public class BasicSearchEngine
extends java.lang.Object

Search basic engine. Public search engine (see SearchEngine for detailed comment), now uses basic engine functionalities. Note that search basic engine does not implement deprecated functionalities...


Field Summary
static boolean VERBOSE
          For tracing purpose.
 
Constructor Summary
BasicSearchEngine()
           
BasicSearchEngine(ICompilationUnit[] workingCopies)
           
BasicSearchEngine(WorkingCopyOwner workingCopyOwner)
           
 
Method Summary
static IJavaSearchScope createHierarchyScope(IType type)
           
static IJavaSearchScope createHierarchyScope(IType type, WorkingCopyOwner owner)
           
static IJavaSearchScope createJavaSearchScope(IJavaElement[] elements)
           
static IJavaSearchScope createJavaSearchScope(IJavaElement[] elements, boolean includeReferencedProjects)
           
static IJavaSearchScope createJavaSearchScope(IJavaElement[] elements, int includeMask)
           
static IJavaSearchScope createStrictHierarchyScope(IJavaProject project, IType type, boolean onlySubtypes, boolean includeFocusType, WorkingCopyOwner owner)
           
static TypeNameMatch createTypeNameMatch(IType type, int modifiers)
           
static IJavaSearchScope createWorkspaceScope()
           
static SearchParticipant getDefaultSearchParticipant()
          Returns a new default Java search participant.
static java.lang.String getMatchRuleString(int matchRule)
           
static java.lang.String getSearchForString(int searchFor)
          Return kind of search corresponding to given value.
 void search(SearchPattern pattern, SearchParticipant[] participants, IJavaSearchScope scope, SearchRequestor requestor, IProgressMonitor monitor)
          Searches for matches of a given search pattern.
 void searchAllConstructorDeclarations(char[] packageName, char[] typeName, int typeMatchRule, IJavaSearchScope scope, IRestrictedAccessConstructorRequestor nameRequestor, int waitingPolicy, IProgressMonitor progressMonitor)
           
 void searchAllSecondaryTypeNames(IPackageFragmentRoot[] sourceFolders, IRestrictedAccessTypeRequestor nameRequestor, boolean waitForIndexes, IProgressMonitor progressMonitor)
          Searches for all secondary types in the given scope.
 void searchAllTypeNames(char[][] qualifications, char[][] typeNames, int matchRule, int searchFor, IJavaSearchScope scope, IRestrictedAccessTypeRequestor nameRequestor, int waitingPolicy, IProgressMonitor progressMonitor)
          Searches for all top-level types and member types in the given scope using a case sensitive exact match with the given qualified names and type names.
 void searchAllTypeNames(char[] packageName, int packageMatchRule, char[] typeName, int typeMatchRule, int searchFor, IJavaSearchScope scope, IRestrictedAccessTypeRequestor nameRequestor, int waitingPolicy, IProgressMonitor progressMonitor)
          Searches for all top-level types and member types in the given scope.
 void searchDeclarations(IJavaElement enclosingElement, SearchRequestor requestor, SearchPattern pattern, IProgressMonitor monitor)
           
 void searchDeclarationsOfAccessedFields(IJavaElement enclosingElement, SearchRequestor requestor, IProgressMonitor monitor)
          Searches for all declarations of the fields accessed in the given element.
 void searchDeclarationsOfReferencedTypes(IJavaElement enclosingElement, SearchRequestor requestor, IProgressMonitor monitor)
          Searches for all declarations of the types referenced in the given element.
 void searchDeclarationsOfSentMessages(IJavaElement enclosingElement, SearchRequestor requestor, IProgressMonitor monitor)
          Searches for all declarations of the methods invoked in the given element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

public static boolean VERBOSE
For tracing purpose.

Constructor Detail

BasicSearchEngine

public BasicSearchEngine()

BasicSearchEngine

public BasicSearchEngine(ICompilationUnit[] workingCopies)
See Also:
for detailed comment.

BasicSearchEngine

public BasicSearchEngine(WorkingCopyOwner workingCopyOwner)
See Also:
for detailed comment.
Method Detail

createHierarchyScope

public static IJavaSearchScope createHierarchyScope(IType type)
                                             throws JavaModelException
Throws:
JavaModelException
See Also:
for detailed comment.

createHierarchyScope

public static IJavaSearchScope createHierarchyScope(IType type,
                                                    WorkingCopyOwner owner)
                                             throws JavaModelException
Throws:
JavaModelException
See Also:
for detailed comment.

createStrictHierarchyScope

public static IJavaSearchScope createStrictHierarchyScope(IJavaProject project,
                                                          IType type,
                                                          boolean onlySubtypes,
                                                          boolean includeFocusType,
                                                          WorkingCopyOwner owner)
                                                   throws JavaModelException
Throws:
JavaModelException
See Also:
for detailed comment.

createJavaSearchScope

public static IJavaSearchScope createJavaSearchScope(IJavaElement[] elements)
See Also:
for detailed comment.

createJavaSearchScope

public static IJavaSearchScope createJavaSearchScope(IJavaElement[] elements,
                                                     boolean includeReferencedProjects)
See Also:
for detailed comment.

createJavaSearchScope

public static IJavaSearchScope createJavaSearchScope(IJavaElement[] elements,
                                                     int includeMask)
See Also:
for detailed comment.

createTypeNameMatch

public static TypeNameMatch createTypeNameMatch(IType type,
                                                int modifiers)
See Also:
for detailed comment.

createWorkspaceScope

public static IJavaSearchScope createWorkspaceScope()
See Also:
for detailed comment.

getDefaultSearchParticipant

public static SearchParticipant getDefaultSearchParticipant()
Returns a new default Java search participant.

Returns:
a new default Java search participant
Since:
3.0

getMatchRuleString

public static java.lang.String getMatchRuleString(int matchRule)
Parameters:
matchRule -

getSearchForString

public static java.lang.String getSearchForString(int searchFor)
Return kind of search corresponding to given value.

Parameters:
searchFor -

search

public void search(SearchPattern pattern,
                   SearchParticipant[] participants,
                   IJavaSearchScope scope,
                   SearchRequestor requestor,
                   IProgressMonitor monitor)
            throws CoreException
Searches for matches of a given search pattern. Search patterns can be created using helper methods (from a String pattern or a Java element) and encapsulate the description of what is being searched (for example, search method declarations in a case sensitive way).

Throws:
CoreException
See Also:
for detailed comment

searchAllConstructorDeclarations

public void searchAllConstructorDeclarations(char[] packageName,
                                             char[] typeName,
                                             int typeMatchRule,
                                             IJavaSearchScope scope,
                                             IRestrictedAccessConstructorRequestor nameRequestor,
                                             int waitingPolicy,
                                             IProgressMonitor progressMonitor)
                                      throws JavaModelException
Throws:
JavaModelException

searchAllSecondaryTypeNames

public void searchAllSecondaryTypeNames(IPackageFragmentRoot[] sourceFolders,
                                        IRestrictedAccessTypeRequestor nameRequestor,
                                        boolean waitForIndexes,
                                        IProgressMonitor progressMonitor)
                                 throws JavaModelException
Searches for all secondary types in the given scope. The search can be selecting specific types (given a package or a type name prefix and match modes).

Throws:
JavaModelException

searchAllTypeNames

public void searchAllTypeNames(char[] packageName,
                               int packageMatchRule,
                               char[] typeName,
                               int typeMatchRule,
                               int searchFor,
                               IJavaSearchScope scope,
                               IRestrictedAccessTypeRequestor nameRequestor,
                               int waitingPolicy,
                               IProgressMonitor progressMonitor)
                        throws JavaModelException
Searches for all top-level types and member types in the given scope. The search can be selecting specific types (given a package or a type name prefix and match modes).

Throws:
JavaModelException
See Also:
for detailed comment

searchAllTypeNames

public void searchAllTypeNames(char[][] qualifications,
                               char[][] typeNames,
                               int matchRule,
                               int searchFor,
                               IJavaSearchScope scope,
                               IRestrictedAccessTypeRequestor nameRequestor,
                               int waitingPolicy,
                               IProgressMonitor progressMonitor)
                        throws JavaModelException
Searches for all top-level types and member types in the given scope using a case sensitive exact match with the given qualified names and type names.

Throws:
JavaModelException
See Also:
for detailed comment

searchDeclarations

public void searchDeclarations(IJavaElement enclosingElement,
                               SearchRequestor requestor,
                               SearchPattern pattern,
                               IProgressMonitor monitor)
                        throws JavaModelException
Throws:
JavaModelException

searchDeclarationsOfAccessedFields

public void searchDeclarationsOfAccessedFields(IJavaElement enclosingElement,
                                               SearchRequestor requestor,
                                               IProgressMonitor monitor)
                                        throws JavaModelException
Searches for all declarations of the fields accessed in the given element. The element can be a compilation unit or a source type/method/field. Reports the field declarations using the given requestor.

Throws:
JavaModelException
See Also:
for detailed comment

searchDeclarationsOfReferencedTypes

public void searchDeclarationsOfReferencedTypes(IJavaElement enclosingElement,
                                                SearchRequestor requestor,
                                                IProgressMonitor monitor)
                                         throws JavaModelException
Searches for all declarations of the types referenced in the given element. The element can be a compilation unit or a source type/method/field. Reports the type declarations using the given requestor.

Throws:
JavaModelException
See Also:
for detailed comment

searchDeclarationsOfSentMessages

public void searchDeclarationsOfSentMessages(IJavaElement enclosingElement,
                                             SearchRequestor requestor,
                                             IProgressMonitor monitor)
                                      throws JavaModelException
Searches for all declarations of the methods invoked in the given element. The element can be a compilation unit or a source type/method/field. Reports the method declarations using the given requestor.

Throws:
JavaModelException
See Also:
for detailed comment