public abstract class PsiElementFinder
extends java.lang.Object
JavaPsiFacade
.Modifier and Type | Field and Description |
---|---|
static ProjectExtensionPointName<PsiElementFinder> |
EP |
static ExtensionPointName<PsiElementFinder> |
EP_NAME
Deprecated.
use
EP |
Constructor and Description |
---|
PsiElementFinder() |
Modifier and Type | Method and Description |
---|---|
static PsiClass [] |
filterByName(java.lang.String className,
PsiClass [] classes) |
abstract 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.
|
abstract 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.
|
PsiClass [] |
getClasses(PsiPackage psiPackage,
GlobalSearchScope scope)
Returns the list of classes in the specified package and in the specified search scope.
|
PsiClass [] |
getClasses(java.lang.String className,
PsiPackage psiPackage,
GlobalSearchScope scope)
Returns the list of classes in the specified package and in the specified search scope.
|
Condition<PsiClass> |
getClassesFilter(GlobalSearchScope scope)
Returns the filter to exclude classes, for example derived classes.
|
protected static java.util.Set<java.lang.String> |
getClassNames(PsiClass [] classes) |
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)
|
PsiFile [] |
getPackageFiles(PsiPackage psiPackage,
GlobalSearchScope scope)
Returns a list of files belonging to the specified package which are not located in any of the package directories.
|
Condition<PsiFile> |
getPackageFilesFilter(PsiPackage psiPackage,
GlobalSearchScope scope)
Returns the filter to use for filtering the list of files in the directories belonging to a package to exclude files
that actually belong to a different package.
|
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 |
processPackageDirectories(PsiPackage psiPackage,
GlobalSearchScope scope,
Processor<? super PsiDirectory> consumer,
boolean includeLibrarySources) |
public static final ProjectExtensionPointName<PsiElementFinder> EP
@Deprecated public static final ExtensionPointName<PsiElementFinder> EP_NAME
EP
public abstract PsiClass findClass(java.lang.String qualifiedName, GlobalSearchScope scope)
qualifiedName
- the full-qualified name of the class to find.scope
- the scope to search.JavaPsiFacade.findClass(String, GlobalSearchScope)
public abstract PsiClass [] findClasses(java.lang.String qualifiedName, GlobalSearchScope scope)
qualifiedName
- the full-qualified name of the class to find.scope
- the scope to search.JavaPsiFacade.findClasses(String, GlobalSearchScope)
public PsiPackage findPackage(java.lang.String qualifiedName)
qualifiedName
- the full-qualified name of the package to find.JavaPsiFacade.findPackage(String)
public PsiPackage [] getSubPackages(PsiPackage psiPackage, GlobalSearchScope scope)
psiPackage
- the package to return the list of subpackages for.scope
- the scope in which subpackages are searched.PsiPackage.getSubPackages(GlobalSearchScope)
public PsiClass [] getClasses(PsiPackage psiPackage, GlobalSearchScope scope)
psiPackage
- the package to return the list of classes in.scope
- the scope in which classes are searched.PsiPackage.getClasses(GlobalSearchScope)
public Condition<PsiClass> getClassesFilter(GlobalSearchScope scope)
scope
- the scope in which classes are searched.public PsiFile [] getPackageFiles(PsiPackage psiPackage, GlobalSearchScope scope)
psiPackage
- the package to return the list of files for.scope
- the scope in which files are searched.public Condition<PsiFile> getPackageFilesFilter(PsiPackage psiPackage, GlobalSearchScope scope)
psiPackage
- the package for which the list of files is requested.scope
- the scope in which children are requested.public java.util.Set<java.lang.String> getClassNames(PsiPackage psiPackage, GlobalSearchScope scope)
protected static java.util.Set<java.lang.String> getClassNames(PsiClass [] classes)
public boolean processPackageDirectories(PsiPackage psiPackage, GlobalSearchScope scope, Processor<? super PsiDirectory> consumer)
public boolean processPackageDirectories(PsiPackage psiPackage, GlobalSearchScope scope, Processor<? super PsiDirectory> consumer, boolean includeLibrarySources)
public PsiClass [] getClasses(java.lang.String className, PsiPackage psiPackage, GlobalSearchScope scope)
className
- short name of the classpsiPackage
- the package to return the list of classes in.scope
- the scope in which classes are searched.PsiPackage.getClasses(GlobalSearchScope)