Class BasicSearchEngine
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.search.BasicSearchEngine
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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBasicSearchEngine(ICompilationUnit[] workingCopies) BasicSearchEngine(WorkingCopyOwner workingCopyOwner) -
Method Summary
Modifier and TypeMethodDescriptionstatic IJavaSearchScopecreateHierarchyScope(IType type) static IJavaSearchScopecreateHierarchyScope(IType type, WorkingCopyOwner owner) static IJavaSearchScopecreateJavaSearchScope(boolean excludeTestCode, IJavaElement[] elements) static IJavaSearchScopecreateJavaSearchScope(boolean excludeTestCode, IJavaElement[] elements, boolean includeReferencedProjects) static IJavaSearchScopecreateJavaSearchScope(boolean excludeTestCode, IJavaElement[] elements, int includeMask) static IJavaSearchScopecreateJavaSearchScope(IJavaElement[] elements) static IJavaSearchScopecreateJavaSearchScope(IJavaElement[] elements, boolean includeReferencedProjects) static IJavaSearchScopecreateJavaSearchScope(IJavaElement[] elements, int includeMask) static MethodNameMatchcreateMethodNameMatch(IMethod method, int modifiers) static IJavaSearchScopecreateStrictHierarchyScope(IJavaProject project, IType type, boolean onlySubtypes, boolean includeFocusType, WorkingCopyOwner owner) static TypeNameMatchcreateTypeNameMatch(IType type, int modifiers) static IJavaSearchScopestatic SearchParticipantReturns a new default Java search participant.static StringgetMatchRuleString(int matchRule) static StringgetSearchForString(int searchFor) Return kind of search corresponding to given value.voidsearch(SearchPattern pattern, SearchParticipant[] participants, IJavaSearchScope scope, SearchRequestor requestor, org.eclipse.core.runtime.IProgressMonitor monitor) Searches for matches of a given search pattern.voidsearchAllConstructorDeclarations(char[] packageName, char[] typeName, int typeMatchRule, IJavaSearchScope scope, boolean resolveDocumentName, IRestrictedAccessConstructorRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Searches for constructor declarations in the given scope.voidsearchAllConstructorDeclarations(char[] packageName, char[] typeName, int typeMatchRule, IJavaSearchScope scope, IRestrictedAccessConstructorRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.IProgressMonitor progressMonitor) voidsearchAllMethodNames(char[] packageName, int pkgMatchRule, char[] declaringQualification, int declQualificationMatchRule, char[] declaringSimpleName, int declSimpleNameMatchRule, char[] methodName, int methodMatchRule, IJavaSearchScope scope, IRestrictedAccessMethodRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Searches for all method declarations in the given scope.voidsearchAllMethodNames(char[] qualifier, int qualifierMatchRule, char[] methodName, int methodMatchRule, IJavaSearchScope scope, IRestrictedAccessMethodRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Searches for all method declarations in the given scope.voidsearchAllSecondaryTypeNames(IPackageFragmentRoot[] sourceFolders, IRestrictedAccessTypeRequestor nameRequestor, boolean waitForIndexes, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Searches for all secondary types in the given scope.voidsearchAllTypeNames(char[][] qualifications, char[][] typeNames, int matchRule, int searchFor, IJavaSearchScope scope, IRestrictedAccessTypeRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.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.voidsearchAllTypeNames(char[] packageName, int packageMatchRule, char[] typeName, int typeMatchRule, int searchFor, IJavaSearchScope scope, boolean resolveDocumentName, IRestrictedAccessTypeRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Searches for all top-level types and member types in the given scope.voidsearchAllTypeNames(char[] packageName, int packageMatchRule, char[] typeName, int typeMatchRule, int searchFor, IJavaSearchScope scope, IRestrictedAccessTypeRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Searches for all top-level types and member types in the given scope.voidsearchDeclarations(IJavaElement enclosingElement, SearchRequestor requestor, SearchPattern pattern, org.eclipse.core.runtime.IProgressMonitor monitor) voidsearchDeclarationsOfAccessedFields(IJavaElement enclosingElement, SearchRequestor requestor, org.eclipse.core.runtime.IProgressMonitor monitor) Searches for all declarations of the fields accessed in the given element.voidsearchDeclarationsOfReferencedTypes(IJavaElement enclosingElement, SearchRequestor requestor, org.eclipse.core.runtime.IProgressMonitor monitor) Searches for all declarations of the types referenced in the given element.voidsearchDeclarationsOfSentMessages(IJavaElement enclosingElement, SearchRequestor requestor, org.eclipse.core.runtime.IProgressMonitor monitor) Searches for all declarations of the methods invoked in the given element.
-
Field Details
-
VERBOSE
public static boolean VERBOSEFor tracing purpose.
-
-
Constructor Details
-
BasicSearchEngine
public BasicSearchEngine() -
BasicSearchEngine
- See Also:
-
BasicSearchEngine
- See Also:
-
-
Method Details
-
createHierarchyScope
- Throws:
JavaModelException- See Also:
-
createHierarchyScope
public static IJavaSearchScope createHierarchyScope(IType type, WorkingCopyOwner owner) throws JavaModelException - Throws:
JavaModelException- See Also:
-
createStrictHierarchyScope
public static IJavaSearchScope createStrictHierarchyScope(IJavaProject project, IType type, boolean onlySubtypes, boolean includeFocusType, WorkingCopyOwner owner) throws JavaModelException - Throws:
JavaModelException- See Also:
-
createJavaSearchScope
- See Also:
-
createJavaSearchScope
public static IJavaSearchScope createJavaSearchScope(boolean excludeTestCode, IJavaElement[] elements) -
createJavaSearchScope
public static IJavaSearchScope createJavaSearchScope(IJavaElement[] elements, boolean includeReferencedProjects) -
createJavaSearchScope
public static IJavaSearchScope createJavaSearchScope(boolean excludeTestCode, IJavaElement[] elements, boolean includeReferencedProjects) - See Also:
-
createJavaSearchScope
-
createJavaSearchScope
public static IJavaSearchScope createJavaSearchScope(boolean excludeTestCode, IJavaElement[] elements, int includeMask) - See Also:
-
createTypeNameMatch
- See Also:
-
createMethodNameMatch
- See Also:
-
createWorkspaceScope
- See Also:
-
getDefaultSearchParticipant
Returns a new default Java search participant.- Returns:
- a new default Java search participant
- Since:
- 3.0
-
getMatchRuleString
-
getSearchForString
Return kind of search corresponding to given value. -
search
public void search(SearchPattern pattern, SearchParticipant[] participants, IJavaSearchScope scope, SearchRequestor requestor, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.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:
org.eclipse.core.runtime.CoreException- See Also:
-
searchAllConstructorDeclarations
public void searchAllConstructorDeclarations(char[] packageName, char[] typeName, int typeMatchRule, IJavaSearchScope scope, IRestrictedAccessConstructorRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws JavaModelException - Throws:
JavaModelException
-
searchAllConstructorDeclarations
public void searchAllConstructorDeclarations(char[] packageName, char[] typeName, int typeMatchRule, IJavaSearchScope scope, boolean resolveDocumentName, IRestrictedAccessConstructorRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws JavaModelException Searches for constructor declarations in the given scope.- Parameters:
resolveDocumentName- used to tell SearchEngine whether to resolve the document name for each result entry.- Throws:
JavaModelException
-
searchAllMethodNames
public void searchAllMethodNames(char[] qualifier, int qualifierMatchRule, char[] methodName, int methodMatchRule, IJavaSearchScope scope, IRestrictedAccessMethodRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws JavaModelException Searches for all method declarations in the given scope. *Warning: This API is in experimental phase and may be modified/removed. Do not use this until this comment is removed.
- Throws:
JavaModelException- See Also:
-
searchAllMethodNames
public void searchAllMethodNames(char[] packageName, int pkgMatchRule, char[] declaringQualification, int declQualificationMatchRule, char[] declaringSimpleName, int declSimpleNameMatchRule, char[] methodName, int methodMatchRule, IJavaSearchScope scope, IRestrictedAccessMethodRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws JavaModelException Searches for all method declarations in the given scope. *Warning: This API is in experimental phase and may be modified/removed. Do not use this until this comment is removed.
- Throws:
JavaModelException- See Also:
-
searchAllSecondaryTypeNames
public void searchAllSecondaryTypeNames(IPackageFragmentRoot[] sourceFolders, IRestrictedAccessTypeRequestor nameRequestor, boolean waitForIndexes, org.eclipse.core.runtime.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, org.eclipse.core.runtime.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:
-
searchAllTypeNames
public void searchAllTypeNames(char[] packageName, int packageMatchRule, char[] typeName, int typeMatchRule, int searchFor, IJavaSearchScope scope, boolean resolveDocumentName, IRestrictedAccessTypeRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.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).- Parameters:
resolveDocumentName- used to tell SearchEngine whether to resolve the document name for each result entry.- Throws:
JavaModelException- See Also:
-
searchAllTypeNames
public void searchAllTypeNames(char[][] qualifications, char[][] typeNames, int matchRule, int searchFor, IJavaSearchScope scope, IRestrictedAccessTypeRequestor nameRequestor, int waitingPolicy, org.eclipse.core.runtime.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:
-
searchDeclarations
public void searchDeclarations(IJavaElement enclosingElement, SearchRequestor requestor, SearchPattern pattern, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException - Throws:
JavaModelException
-
searchDeclarationsOfAccessedFields
public void searchDeclarationsOfAccessedFields(IJavaElement enclosingElement, SearchRequestor requestor, org.eclipse.core.runtime.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:
-
searchDeclarationsOfReferencedTypes
public void searchDeclarationsOfReferencedTypes(IJavaElement enclosingElement, SearchRequestor requestor, org.eclipse.core.runtime.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:
-
searchDeclarationsOfSentMessages
public void searchDeclarationsOfSentMessages(IJavaElement enclosingElement, SearchRequestor requestor, org.eclipse.core.runtime.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:
-