public abstract class NonClasspathClassFinder extends PsiElementFinder
Modifier and Type | Field and Description |
---|---|
protected Project |
myProject |
EP, EP_NAME
Constructor and Description |
---|
NonClasspathClassFinder(Project project,
java.lang.String... fileExtensions) |
Modifier and Type | Method and Description |
---|---|
static GlobalSearchScope |
addNonClasspathScope(Project project,
GlobalSearchScope base) |
protected abstract java.util.List<VirtualFile> |
calcClassRoots() |
void |
clearCache() |
protected static PackageDirectoryCache |
createCache(java.util.List<? extends VirtualFile> roots)
Deprecated.
|
PsiClass |
findClass(java.lang.String qualifiedName,
GlobalSearchScope scope)
Searches the specified scope within the project for a class with the specified full-qualified
name and returns one if it is found.
|
PsiClass [] |
findClasses(java.lang.String qualifiedName,
GlobalSearchScope scope)
Searches the specified scope within the project for classes with the specified full-qualified
name and returns all found classes.
|
PsiPackage |
findPackage(java.lang.String qualifiedName)
Searches the project for the package with the specified full-qualified name and returns one
if it is found.
|
protected PackageDirectoryCache |
getCache(GlobalSearchScope scope) |
PsiClass [] |
getClasses(PsiPackage psiPackage,
GlobalSearchScope scope)
Returns the list of classes in the specified package and in the specified search scope.
|
java.util.Set<java.lang.String> |
getClassNames(PsiPackage psiPackage,
GlobalSearchScope scope)
A method to optimize resolve (to only search classes in a package which might be there)
|
java.util.List<VirtualFile> |
getClassRoots() |
protected java.util.List<VirtualFile> |
getClassRoots(GlobalSearchScope scope) |
PsiManager |
getPsiManager() |
PsiPackage [] |
getSubPackages(PsiPackage psiPackage,
GlobalSearchScope scope)
Returns the list of subpackages of the specified package in the specified search scope.
|
boolean |
processPackageDirectories(PsiPackage psiPackage,
GlobalSearchScope scope,
Processor<? super PsiDirectory> consumer,
boolean includeLibrarySources) |
filterByName, getClasses, getClassesFilter, getClassNames, getPackageFiles, getPackageFilesFilter, processPackageDirectories
protected final Project myProject
public NonClasspathClassFinder(Project project, java.lang.String... fileExtensions)
protected PackageDirectoryCache getCache(GlobalSearchScope scope)
@Deprecated protected static PackageDirectoryCache createCache(java.util.List<? extends VirtualFile> roots)
PackageDirectoryCache.createCache(List)
public void clearCache()
protected java.util.List<VirtualFile> getClassRoots(GlobalSearchScope scope)
public java.util.List<VirtualFile> getClassRoots()
public PsiClass findClass(java.lang.String qualifiedName, GlobalSearchScope scope)
PsiElementFinder
findClass
in class PsiElementFinder
qualifiedName
- the full-qualified name of the class to find.scope
- the scope to search.JavaPsiFacade.findClass(String, GlobalSearchScope)
protected abstract java.util.List<VirtualFile> calcClassRoots()
public PsiClass [] getClasses(PsiPackage psiPackage, GlobalSearchScope scope)
PsiElementFinder
getClasses
in class PsiElementFinder
psiPackage
- the package to return the list of classes in.scope
- the scope in which classes are searched.PsiPackage.getClasses(GlobalSearchScope)
public java.util.Set<java.lang.String> getClassNames(PsiPackage psiPackage, GlobalSearchScope scope)
PsiElementFinder
getClassNames
in class PsiElementFinder
public PsiPackage findPackage(java.lang.String qualifiedName)
PsiElementFinder
findPackage
in class PsiElementFinder
qualifiedName
- the full-qualified name of the package to find.JavaPsiFacade.findPackage(String)
public boolean processPackageDirectories(PsiPackage psiPackage, GlobalSearchScope scope, Processor<? super PsiDirectory> consumer, boolean includeLibrarySources)
processPackageDirectories
in class PsiElementFinder
public PsiPackage [] getSubPackages(PsiPackage psiPackage, GlobalSearchScope scope)
PsiElementFinder
getSubPackages
in class PsiElementFinder
psiPackage
- the package to return the list of subpackages for.scope
- the scope in which subpackages are searched.PsiPackage.getSubPackages(GlobalSearchScope)
public PsiClass [] findClasses(java.lang.String qualifiedName, GlobalSearchScope scope)
PsiElementFinder
findClasses
in class PsiElementFinder
qualifiedName
- the full-qualified name of the class to find.scope
- the scope to search.JavaPsiFacade.findClasses(String, GlobalSearchScope)
public static GlobalSearchScope addNonClasspathScope(Project project, GlobalSearchScope base)
public PsiManager getPsiManager()