|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.intellij.psi.PsiManager
public abstract class PsiManager
The main entry point for accessing the PSI services for a project.
| Constructor Summary | |
|---|---|
PsiManager()
|
|
| Method Summary | |
|---|---|
abstract void |
addPsiTreeChangeListener(PsiTreeChangeListener listener)
Adds a listener for receiving notifications about all changes in the PSI tree of the project. |
abstract boolean |
areElementsEquivalent(PsiElement element1,
PsiElement element2)
Checks if the specified two PSI elements (possibly invalid) represent the same source element (for example, a class with the same full-qualified name). |
abstract boolean |
arePackagesTheSame(PsiElement element1,
PsiElement element2)
Checks if the specified PSI elements belong to the same package. |
abstract void |
checkMove(PsiElement element,
PsiElement newContainer)
Checks if it is possible to move the specified PSI element under the specified container, and throws an exception if the move is not possible. |
abstract void |
dropResolveCaches()
Clears the resolve caches of the PSI manager. |
abstract PsiClass |
findClass(java.lang.String qualifiedName)
Deprecated. use findClass(String, GlobalSearchScope) |
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. |
abstract PsiDirectory |
findDirectory(VirtualFile file)
Returns the PSI directory corresponding to the specified virtual file system directory. |
abstract PsiFile |
findFile(VirtualFile file)
Returns the PSI file corresponding to the specified virtual file. |
abstract PsiPackage |
findPackage(java.lang.String qualifiedName)
Searches the project for the package with the specified full-qualified name and retunrs one if it is found. |
abstract void |
finishBatchFilesProcessingMode()
Notifies the PSI manager that a batch operation sequentially processing multiple files is finishing. |
abstract PsiAspectManager |
getAspectManager()
Returns the aspect manager for the project, which can be used to access AspectJ-related functionality. |
abstract CachedValuesManager |
getCachedValuesManager()
Returns the cached values manager for the project, which can be used to create values which are automatically recalculated based on changes of the elements on which they depend. |
abstract CodeStyleManager |
getCodeStyleManager()
Returns the code style manager for the project. |
abstract PsiConstantEvaluationHelper |
getConstantEvaluationHelper()
Returns the constant expression evaluator for the project. |
abstract LanguageLevel |
getEffectiveLanguageLevel()
Returns the language level set for this project. |
abstract PsiElementFactory |
getElementFactory()
Returns the element factory for the project, which can be used to create instances of Java and XML PSI elements. |
static PsiManager |
getInstance(Project project)
Returns the PSI manager instance for the specified project. |
abstract JavadocManager |
getJavadocManager()
Returns the JavaDoc manager for the project, which can be used to retrieve information about JavaDoc tags known to IDEA. |
abstract PsiModificationTracker |
getModificationTracker()
Returns the modification tracker for the project, which can be used to get the PSI modification count value. |
abstract PsiNameHelper |
getNameHelper()
Returns the name helper for the project, which can be used to validate and parse Java identifiers. |
abstract Project |
getProject()
Returns the project with which the PSI manager is associated. |
abstract PsiResolveHelper |
getResolveHelper()
Returns the resolve helper for the project, which can be used to resolve references and check accessibility of elements. |
abstract PsiDirectory[] |
getRootDirectories(int rootType)
Deprecated. |
abstract PsiSearchHelper |
getSearchHelper()
Returns the search helper for the project, which provides low-level search and find usages functionality. |
abstract PsiShortNamesCache |
getShortNamesCache()
Returns the short name cache for the project, which can be used to locate files, classes, methods and fields by non-qualified names. |
abstract boolean |
isDisposed()
Checks if the PSI manager has been disposed and the PSI for this project can no longer be used. |
abstract boolean |
isInPackage(PsiElement element,
PsiPackage aPackage)
Checks if the specified PSI element belongs to the specified package. |
abstract boolean |
isInProject(PsiElement element)
Checks if the specified PSI element belongs to the sources of the project. |
abstract 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. |
abstract void |
moveDirectory(PsiDirectory dir,
PsiDirectory newParentDir)
Moves the specified directory to the specified parent directory. |
abstract void |
moveFile(PsiFile file,
PsiDirectory newParentDir)
Moves the specified file to the specified directory. |
abstract void |
performActionWithFormatterDisabled(java.lang.Runnable r)
Disables automatic formatting of modified PSI elements, runs the specified operation and re-enables the formatting. |
abstract void |
registerShortNamesCache(PsiShortNamesCache cache)
Registers a custom short name cache implementation for the project, which is used in addition to the standard IDEA implementation. |
abstract void |
reloadFromDisk(PsiFile file)
Reloads the contents of the specified PSI file and its associated document (if any) from the disk. |
abstract void |
removePsiTreeChangeListener(PsiTreeChangeListener listener)
Removes a listener for receiving notifications about all changes in the PSI tree of the project. |
abstract void |
setEffectiveLanguageLevel(LanguageLevel languageLevel)
Sets the language level to use for this project. |
abstract void |
startBatchFilesProcessingMode()
Notifies the PSI manager that a batch operation sequentially processing multiple files is starting. |
abstract PsiMigration |
startMigration()
Initiates a migrate refactoring. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.intellij.openapi.util.UserDataHolder |
|---|
getUserData, putUserData |
| Constructor Detail |
|---|
public PsiManager()
| Method Detail |
|---|
@NotNull
public static PsiManager getInstance(@NotNull
Project project)
project - the project for which the PSI manager is requested.
@NotNull public abstract Project getProject()
@NotNull public abstract PsiDirectory[] getRootDirectories(int rootType)
@Nullable
public abstract PsiFile findFile(@NotNull
VirtualFile file)
file - the file for which the PSI is requested.
@Nullable
public abstract PsiDirectory findDirectory(@NotNull
VirtualFile file)
file - the directory for which the PSI is requested.
@Nullable
public abstract PsiClass findClass(@NotNull
java.lang.String qualifiedName)
findClass(String, GlobalSearchScope)
qualifiedName - the full-qualified name of the class to find.
@Nullable
public abstract PsiClass findClass(@NotNull
java.lang.String qualifiedName,
@NotNull
GlobalSearchScope scope)
qualifiedName - the full-qualified name of the class to find.scope - the scope to search.
@NotNull
public abstract PsiClass[] findClasses(@NotNull
java.lang.String qualifiedName,
@NotNull
GlobalSearchScope scope)
qualifiedName - the full-qualified name of the class to find.scope - the scope to search.
@Nullable
public abstract PsiPackage findPackage(@NotNull
java.lang.String qualifiedName)
qualifiedName - the full-qualified name of the package to find.
public abstract boolean areElementsEquivalent(@Nullable
PsiElement element1,
@Nullable
PsiElement element2)
element1 - the first element to check for equivalenceelement2 - the second element to check for equivalence
public abstract void reloadFromDisk(@NotNull
PsiFile file)
file - the PSI file to reload.
public abstract void addPsiTreeChangeListener(@NotNull
PsiTreeChangeListener listener)
listener - the listener instance.
public abstract void removePsiTreeChangeListener(@NotNull
PsiTreeChangeListener listener)
listener - the listener instance.@NotNull public abstract CodeStyleManager getCodeStyleManager()
@NotNull public abstract PsiElementFactory getElementFactory()
@NotNull public abstract PsiSearchHelper getSearchHelper()
@NotNull public abstract PsiResolveHelper getResolveHelper()
@NotNull public abstract PsiShortNamesCache getShortNamesCache()
public abstract void registerShortNamesCache(@NotNull
PsiShortNamesCache cache)
cache - the short name cache instance.@NotNull public abstract PsiMigration startMigration()
PsiMigration.finish() is called.
@NotNull public abstract JavadocManager getJavadocManager()
@NotNull public abstract PsiNameHelper getNameHelper()
@NotNull public abstract PsiConstantEvaluationHelper getConstantEvaluationHelper()
@NotNull public abstract PsiModificationTracker getModificationTracker()
@NotNull public abstract PsiAspectManager getAspectManager()
@NotNull public abstract CachedValuesManager getCachedValuesManager()
public abstract void moveFile(@NotNull
PsiFile file,
@NotNull
PsiDirectory newParentDir)
throws IncorrectOperationException
file - the file to move.newParentDir - the directory to move the file into.
IncorrectOperationException - if the modification is not supported or not possible for some reason.
public abstract void moveDirectory(@NotNull
PsiDirectory dir,
@NotNull
PsiDirectory newParentDir)
throws IncorrectOperationException
dir - the directory to move.newParentDir - the directory to move dir into.
IncorrectOperationException - if the modification is not supported or not possible for some reason.
public abstract void checkMove(@NotNull
PsiElement element,
@NotNull
PsiElement newContainer)
throws IncorrectOperationException
element - the element to check the move possibility.newContainer - the target container element to move into.
IncorrectOperationException - if the modification is not supported or not possible for some reason.public abstract void startBatchFilesProcessingMode()
public abstract void finishBatchFilesProcessingMode()
public abstract boolean isDisposed()
@NotNull public abstract LanguageLevel getEffectiveLanguageLevel()
public abstract boolean isPartOfPackagePrefix(java.lang.String packageName)
packageName - the package name to check.
public abstract void setEffectiveLanguageLevel(@NotNull
LanguageLevel languageLevel)
languageLevel - the language level to set.public abstract void dropResolveCaches()
public abstract boolean isInPackage(@NotNull
PsiElement element,
@NotNull
PsiPackage aPackage)
element - the element to check the package for.aPackage - the package to check.
public abstract boolean arePackagesTheSame(@NotNull
PsiElement element1,
@NotNull
PsiElement element2)
element1 - the first element to check.element2 - the second element to check.
public abstract boolean isInProject(@NotNull
PsiElement element)
element - the element to check.
public abstract void performActionWithFormatterDisabled(java.lang.Runnable r)
r - the operation to run.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||