public abstract class PsiJavaFileBaseImpl extends PsiFileImpl implements PsiJavaFile
Queryable.Contributor, Queryable.PrintInfo, Queryable.Util
BUILDING_STUB, myContentElementType, myManager, myOriginalFile
FLAGS_LOCKED, ICON_PLACEHOLDER
EMPTY_ARRAY
EMPTY_NAVIGATABLE_ELEMENT_ARRAY
EMPTY_NAVIGATION_ITEM_ARRAY
BATCH_REFERENCE_PROCESSING
Modifier | Constructor and Description |
---|---|
protected |
PsiJavaFileBaseImpl(IElementType elementType,
IElementType contentElementType,
FileViewProvider viewProvider) |
Modifier and Type | Method and Description |
---|---|
void |
accept(PsiElementVisitor visitor)
Passes the element to the specified visitor.
|
void |
clearCaches()
Invalidate any file-specific cache in this method.
|
PsiJavaCodeReferenceElement |
findImportReferenceTo(PsiClass aClass)
Returns the single-class import statement which references
the specified class, or null if there is no such statement.
|
PsiClass [] |
getClasses() |
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.
|
Language |
getLanguage()
Returns the language of the PSI element.
|
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.
|
boolean |
importClass(PsiClass aClass)
Adds an import statement for importing the specified class.
|
boolean |
processDeclarations(PsiScopeProcessor processor,
ResolveState state,
PsiElement lastParent,
PsiElement place)
Passes the declarations contained in this PSI element and its children
for processing to the specified scope processor.
|
void |
setOriginalFile(PsiFile originalFile) |
void |
setPackageName(java.lang.String packageName) |
void |
subtreeChanged()
Called by the PSI framework when the contents of the file changes.
|
acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, assertReadAccessAllowed, beforeAstChange, calcStubTree, calcTreeElement, canNavigate, canNavigateToSource, checkAdd, checkDelete, checkSetName, clone, cloneImpl, copy, createContentLeafElement, createFileElement, delete, deleteChildRange, derefStub, findChildByClass, findChildrenByClass, findElementAt, findReferenceAt, getChildren, getContainingDirectory, getContainingFile, getContentElementType, getContext, getElementTypeForStubBuilder, getFileElementType, getFirstChild, getGreenStub, getGreenStubTree, getLastChild, getManager, getModificationStamp, getName, getNavigationElement, getNextSibling, getNode, getOriginalElement, getOriginalFile, getParent, getPresentation, getPrevSibling, getProject, getPsiRoots, getReference, getReferences, getResolveScope, getStartOffsetInParent, getStub, getStubbedSpine, getStubTree, getText, getTextLength, getTextOffset, getTextRange, getTreeElement, getUseScope, getViewProvider, getVirtualFile, init, isContentsLoaded, isDirectory, isEquivalentTo, isPhysical, isTemplateDataFile, isValid, isWritable, markInvalidated, navigate, onContentReload, processChildren, putInfo, putInfo, replace, setContentElementType, setName, setTreeElementPointer, textContains, textMatches, textMatches, textToCharArray, toString
buildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getElementIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, isVisibilitySupported, overlayIcons, registerIconLayer, transformFlags
changeUserMap, clearUserData, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getContainingDirectory, getFileElementType, getFileType, getModificationStamp, getNode, getOriginalFile, getParent, getPsiRoots, getViewProvider, getVirtualFile
getName, isDirectory, processChildren
checkSetName
setName
getPresentation
canNavigate, canNavigateToSource, navigate
protected PsiJavaFileBaseImpl(IElementType elementType, IElementType contentElementType, FileViewProvider viewProvider)
public void subtreeChanged()
PsiFile
PsiFile.clearCaches()
since file contents can be reloaded completely (without any specific subtree change) without this method being called.subtreeChanged
in interface PsiFile
subtreeChanged
in class PsiFileImpl
public PsiClass [] getClasses()
getClasses
in interface PsiClassOwner
public PsiPackageStatement getPackageStatement()
PsiJavaFile
getPackageStatement
in interface PsiJavaFile
public java.lang.String getPackageName()
PsiJavaFile
getPackageName
in interface PsiClassOwner
getPackageName
in interface PsiJavaFile
public void setPackageName(java.lang.String packageName) throws IncorrectOperationException
setPackageName
in interface PsiClassOwner
IncorrectOperationException
public PsiImportList getImportList()
PsiJavaFile
getImportList
in interface PsiJavaFile
public PsiElement [] getOnDemandImports(boolean includeImplicit, boolean checkIncludes)
PsiJavaFile
getOnDemandImports
in interface PsiJavaFile
includeImplicit
- if true, implicitly imported packages (like java.lang) are included.checkIncludes
- deprecated, no longer usedpublic PsiClass [] getSingleClassImports(boolean checkIncludes)
PsiJavaFile
getSingleClassImports
in interface PsiJavaFile
checkIncludes
- deprecated, no longer used.public PsiJavaCodeReferenceElement findImportReferenceTo(PsiClass aClass)
PsiJavaFile
findImportReferenceTo
in interface PsiJavaFile
aClass
- the class to return the import statement for.public java.lang.String [] getImplicitlyImportedPackages()
PsiJavaFile
getImplicitlyImportedPackages
in interface PsiJavaFile
public PsiJavaCodeReferenceElement [] getImplicitlyImportedPackageReferences()
PsiJavaFile
getImplicitlyImportedPackageReferences
in interface PsiJavaFile
public boolean processDeclarations(PsiScopeProcessor processor, ResolveState state, PsiElement lastParent, PsiElement place)
PsiElement
processDeclarations
in interface PsiElement
processDeclarations
in class PsiFileImpl
processor
- the processor receiving the declarations.lastParent
- the child of this element has been processed during the previous
step of the tree up walk (declarations under this element do not need
to be processed again)place
- the original element from which the tree up walk was initiated.public void accept(PsiElementVisitor visitor)
PsiElement
accept
in interface PsiElement
visitor
- the visitor to pass the element to.public Language getLanguage()
PsiElement
getLanguage
in interface PsiElement
getLanguage
in class PsiFileImpl
public boolean importClass(PsiClass aClass)
PsiImportHolder
importClass
in interface PsiImportHolder
aClass
- the class to import.public LanguageLevel getLanguageLevel()
getLanguageLevel
in interface PsiJavaFile
public PsiJavaModule getModuleDeclaration()
PsiJavaFile
null
if the file is not a module-info one.getModuleDeclaration
in interface PsiJavaFile
public void clearCaches()
PsiFile
clearCaches
in interface PsiFile
clearCaches
in class PsiFileImpl
public void setOriginalFile(PsiFile originalFile)
setOriginalFile
in class PsiFileImpl