public interface PsiJavaFile extends PsiImportHolder, PsiClassOwner
EMPTY_ARRAY
EMPTY_NAVIGATABLE_ELEMENT_ARRAY
EMPTY_NAVIGATION_ITEM_ARRAY
Modifier and Type | Method and Description |
---|---|
PsiJavaCodeReferenceElement |
findImportReferenceTo(PsiClass aClass)
Returns the single-class import statement which references
the specified class, or null if there is no such statement.
|
PsiJavaCodeReferenceElement [] |
getImplicitlyImportedPackageReferences()
returns the list of reference elements for the
implicitly imported packages (for example, java.lang).
|
java.lang.String [] |
getImplicitlyImportedPackages()
Returns the list of names of implicitly imported packages
(for example, java.lang).
|
PsiImportList |
getImportList()
Returns the import list contained in the file.
|
LanguageLevel |
getLanguageLevel() |
PsiJavaModule |
getModuleDeclaration()
Returns a Java module declaration element, or
null if the file is not a module-info one. |
PsiElement [] |
getOnDemandImports(boolean includeImplicit,
boolean checkIncludes)
Returns the list of classes or packages which have been
imported on demand (for example, javax.swing.*)
|
java.lang.String |
getPackageName()
Returns the name of the package to which the file belongs.
|
PsiPackageStatement |
getPackageStatement()
Returns the package statement contained in the file.
|
PsiClass [] |
getSingleClassImports(boolean checkIncludes)
Returns the list of classes which have been imported as
single-class imports.
|
importClass
getClasses, setPackageName
clearCaches, getContainingDirectory, getFileElementType, getFileType, getModificationStamp, getNode, getOriginalFile, getParent, getPsiRoots, getViewProvider, getVirtualFile, subtreeChanged
getName, isDirectory, processChildren
checkSetName
setName
getPresentation
canNavigate, canNavigateToSource, navigate
PsiPackageStatement getPackageStatement()
java.lang.String getPackageName()
getPackageName
in interface PsiClassOwner
PsiImportList getImportList()
PsiElement [] getOnDemandImports(boolean includeImplicit, @Deprecated boolean checkIncludes)
includeImplicit
- if true, implicitly imported packages (like java.lang) are included.checkIncludes
- deprecated, no longer usedPsiClass [] getSingleClassImports(@Deprecated boolean checkIncludes)
checkIncludes
- deprecated, no longer used.java.lang.String [] getImplicitlyImportedPackages()
PsiJavaCodeReferenceElement [] getImplicitlyImportedPackageReferences()
PsiJavaCodeReferenceElement findImportReferenceTo(PsiClass aClass)
aClass
- the class to return the import statement for.LanguageLevel getLanguageLevel()
PsiJavaModule getModuleDeclaration()
null
if the file is not a module-info one.