|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PsiFile
A PSI element representing a file.
| Field Summary | |
|---|---|
static PsiFile[] |
EMPTY_ARRAY
The empty array of PSI files which can be reused to avoid unnecessary allocations. |
| Method Summary | |
|---|---|
boolean |
canContainJavaCode()
Checks if the file is a Java source file or Java code fragment. |
PsiFile |
createPseudoPhysicalCopy()
Creates a copy which is considered physical (see PsiElement.isPhysical())
for a PSI file which is not backed by a VirtualFile. |
PsiJavaCodeReferenceElement |
findImportReferenceTo(PsiClass aClass)
For Java/JSP files only: returns the single-class import statement which references the specified class, or null if there is no such statement. |
PsiDirectory |
getContainingDirectory()
Returns the directory containing the file. |
FileType |
getFileType()
Returns the file type for the file. |
PsiJavaCodeReferenceElement[] |
getImplicitlyImportedPackageReferences()
For Java/JSP files only: returns the list of reference elements for the implicitly imported packages (for example, java.lang). |
java.lang.String[] |
getImplicitlyImportedPackages()
For Java/JSP files only: returns the list of names of implicitly imported packages (for example, java.lang). |
long |
getModificationStamp()
Gets the modification stamp value. |
PsiElement[] |
getOnDemandImports(boolean includeImplicit,
boolean checkIncludes)
For Java/JSP files only: returns the list of classes or packages which have been imported on demand (for example, javax.swing.*) |
PsiFile |
getOriginalFile()
If the file is a non-physical copy of a file, returns the original file which had been copied. |
PsiFile[] |
getPsiRoots()
If the file contains multiple interspersed languages, returns the roots for PSI trees for each of these languages. |
PsiClass[] |
getSingleClassImports(boolean checkIncludes)
For Java/JSP files only: returns the list of classs which have been imported as single-class imports. |
VirtualFile |
getVirtualFile()
Returns the virtual file corresponding to the PSI file. |
void |
setModificationStamp(long modificationStamp)
Sets the modification stamp value. |
| Methods inherited from interface com.intellij.psi.PsiFileSystemItem |
|---|
checkSetName |
| Methods inherited from interface com.intellij.psi.PsiNamedElement |
|---|
getName, setName |
| Field Detail |
|---|
static final PsiFile[] EMPTY_ARRAY
| Method Detail |
|---|
@Nullable VirtualFile getVirtualFile()
@Nullable PsiDirectory getContainingDirectory()
long getModificationStamp()
VirtualFile.getModificationStamp(),
setModificationStamp(long)void setModificationStamp(long modificationStamp)
modificationStamp - the new modification stamp value.getModificationStamp()
@NotNull
PsiElement[] getOnDemandImports(boolean includeImplicit,
@Deprecated
boolean checkIncludes)
includeImplicit - if true, implicitly imported packages (like java.lang) are included.checkIncludes - deprecated, no longer used
@NotNull
PsiClass[] getSingleClassImports(@Deprecated
boolean checkIncludes)
checkIncludes - deprecated, no longer used.
@NotNull java.lang.String[] getImplicitlyImportedPackages()
@NotNull PsiJavaCodeReferenceElement[] getImplicitlyImportedPackageReferences()
@Nullable PsiJavaCodeReferenceElement findImportReferenceTo(PsiClass aClass)
aClass - the class to return the import statement for.
@Nullable PsiFile getOriginalFile()
boolean canContainJavaCode()
@NotNull FileType getFileType()
@NotNull PsiFile[] getPsiRoots()
this
if the file has only a single language.@NotNull PsiFile createPseudoPhysicalCopy()
PsiElement.isPhysical())
for a PSI file which is not backed by a VirtualFile. This allows, for example, to obtain a
Document instance for such a file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||