public class JavaPsiFacadeImpl extends JavaPsiFacadeEx
Constructor and Description |
---|
JavaPsiFacadeImpl(Project project) |
Modifier and Type | Method and Description |
---|---|
boolean |
arePackagesTheSame(PsiElement element1,
PsiElement element2)
Checks if the specified PSI elements belong to the same package.
|
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.
|
java.util.List<PsiClass> |
findClassesWithoutJvmFacade(java.lang.String qualifiedName,
GlobalSearchScope scope) |
PsiJavaModule |
findModule(java.lang.String moduleName,
GlobalSearchScope scope)
Searches the scope for a unique Java module with the given name.
|
java.util.Collection<PsiJavaModule> |
findModules(java.lang.String moduleName,
GlobalSearchScope scope)
Searches the scope for Java modules with the given name.
|
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) |
java.util.Set<java.lang.String> |
getClassNames(PsiPackage psiPackage,
GlobalSearchScope scope) |
PsiConstantEvaluationHelper |
getConstantEvaluationHelper()
Returns the constant expression evaluator for the project.
|
PsiElementFactory |
getElementFactory()
Returns the element factory for the project, which can be used to
create instances of Java elements.
|
PsiNameHelper |
getNameHelper()
Returns the name helper for the project, which can be used to validate
and parse Java identifiers.
|
PsiFile [] |
getPackageFiles(PsiPackage psiPackage,
GlobalSearchScope scope) |
PsiJavaParserFacade |
getParserFacade()
Returns the factory for the project, which can be used to create instances of certain Java constructs from their textual
representation.
|
Project |
getProject() |
PsiResolveHelper |
getResolveHelper()
Returns the resolve helper for the project, which can be used to resolve references
and check accessibility of elements.
|
PsiPackage [] |
getSubPackages(PsiPackage psiPackage,
GlobalSearchScope scope) |
boolean |
isConstantExpression(PsiExpression expression) |
boolean |
isInPackage(PsiElement element,
PsiPackage aPackage)
Checks if the specified PSI element belongs to the specified package.
|
boolean |
isPartOfPackagePrefix(java.lang.String packageName)
Checks if the specified package name is part of the package prefix for
any of the modules in this project.
|
boolean |
processPackageDirectories(PsiPackage psiPackage,
GlobalSearchScope scope,
Processor<? super PsiDirectory> consumer,
boolean includeLibrarySources) |
findClass, getInstanceEx
getElementFactory, getInstance
public JavaPsiFacadeImpl(Project project)
public PsiClass findClass(java.lang.String qualifiedName, GlobalSearchScope scope)
JavaPsiFacade
findClass
in class JavaPsiFacade
null
if no class with such name is found.public PsiClass [] findClasses(java.lang.String qualifiedName, GlobalSearchScope scope)
JavaPsiFacade
findClasses
in class JavaPsiFacade
public java.util.List<PsiClass> findClassesWithoutJvmFacade(java.lang.String qualifiedName, GlobalSearchScope scope)
public PsiConstantEvaluationHelper getConstantEvaluationHelper()
JavaPsiFacade
getConstantEvaluationHelper
in class JavaPsiFacade
public PsiPackage findPackage(java.lang.String qualifiedName)
JavaPsiFacade
findPackage
in class JavaPsiFacade
null
if no package with such name is found.public PsiJavaModule findModule(java.lang.String moduleName, GlobalSearchScope scope)
JavaPsiFacade
findModule
in class JavaPsiFacade
public java.util.Collection<PsiJavaModule> findModules(java.lang.String moduleName, GlobalSearchScope scope)
JavaPsiFacade
findModules
in class JavaPsiFacade
public PsiJavaParserFacade getParserFacade()
JavaPsiFacade
JavaPsiFacade.getElementFactory()
instead, which
provides exactly same methods but ensures created instances will get properly formatted.getParserFacade
in class JavaPsiFacade
public PsiResolveHelper getResolveHelper()
JavaPsiFacade
getResolveHelper
in class JavaPsiFacade
public PsiNameHelper getNameHelper()
JavaPsiFacade
getNameHelper
in class JavaPsiFacade
public java.util.Set<java.lang.String> getClassNames(PsiPackage psiPackage, GlobalSearchScope scope)
public PsiClass [] getClasses(PsiPackage psiPackage, GlobalSearchScope scope)
public PsiFile [] getPackageFiles(PsiPackage psiPackage, GlobalSearchScope scope)
public boolean processPackageDirectories(PsiPackage psiPackage, GlobalSearchScope scope, Processor<? super PsiDirectory> consumer, boolean includeLibrarySources)
public PsiPackage [] getSubPackages(PsiPackage psiPackage, GlobalSearchScope scope)
public boolean isPartOfPackagePrefix(java.lang.String packageName)
JavaPsiFacade
isPartOfPackagePrefix
in class JavaPsiFacade
public boolean isInPackage(PsiElement element, PsiPackage aPackage)
JavaPsiFacade
isInPackage
in class JavaPsiFacade
public boolean arePackagesTheSame(PsiElement element1, PsiElement element2)
JavaPsiFacade
arePackagesTheSame
in class JavaPsiFacade
public Project getProject()
getProject
in class JavaPsiFacade
public boolean isConstantExpression(PsiExpression expression)
isConstantExpression
in class JavaPsiFacade
public PsiElementFactory getElementFactory()
JavaPsiFacade
getElementFactory
in class JavaPsiFacade