程序包 com.intellij.psi

接口 PsiFile

所有超级接口:
PsiElement
所有已知子接口:
PsiBinaryFile, PsiPlainTextFile

public interface PsiFile extends PsiElement
A PSI element representing a file.

Please see IntelliJ Platform Architectural Overview for high-level overview.

另请参阅:
  • fleet.com.intellij.openapi.actionSystem.LangDataKeys#PSI_FILE
  • PsiElement.getContainingFile()
  • PsiManager#findFile(VirtualFile)
  • PsiDocumentManager#getPsiFile(fleet.com.intellij.openapi.editor.Document)
  • 字段详细资料

    • EMPTY_ARRAY

      static final PsiFile[] EMPTY_ARRAY
      The empty array of PSI files which can be reused to avoid unnecessary allocations.
  • 方法详细资料

    • getModificationStamp

      long getModificationStamp()
      Gets the modification stamp value. Modification stamp is a value changed by any modification of the content of the file. Note that it is not related to the file modification time.
      返回:
      the modification stamp value
      另请参阅:
      • VirtualFile#getModificationStamp()
    • getOriginalFile

      @NotNull @NotNull PsiFile getOriginalFile()
      If the file is a non-physical copy of a file, returns the original file which had been copied. Otherwise, returns the same file.
      返回:
      the original file of a copy, or the same file if the file is not a copy.
    • getPsiRoots

      @Deprecated @NotNull @NotNull PsiFile[] getPsiRoots()
      已过时。
      Use FileViewProvider#getAllFiles() instead.
      If the file contains multiple interspersed languages, returns the roots for PSI trees for each of these languages. (For example, a JSPX file contains JSP, XML and Java trees.)
      返回:
      the array of PSI roots, or a single-element array containing this if the file has only a single language.
    • subtreeChanged

      void subtreeChanged()
      Called by the PSI framework when the contents of the file changes. If you override this method, you must call the base class implementation. While this method can be used to invalidate file-level caches, it is more much safe to invalidate them in clearCaches() since file contents can be reloaded completely (without any specific subtree change) without this method being called.
    • clearCaches

      default void clearCaches()
      Invalidate any file-specific cache in this method. It is called on file content change. If you override this method, you must call the base class implementation.