public class PsiCodeFragmentImpl extends PsiFileImpl implements JavaCodeFragment, IntentionFilterOwner
JavaCodeFragment.ExceptionHandler, JavaCodeFragment.VisibilityCheckerIntentionFilterOwner.IntentionActionsFilterQueryable.Contributor, Queryable.PrintInfo, Queryable.UtilBUILDING_STUB, myContentElementType, myManager, myOriginalFileFLAGS_LOCKED, ICON_PLACEHOLDEREMPTY_ARRAYEMPTY_NAVIGATABLE_ELEMENT_ARRAYEMPTY_NAVIGATION_ITEM_ARRAYBATCH_REFERENCE_PROCESSING| Constructor and Description |
|---|
PsiCodeFragmentImpl(Project project,
IElementType contentElementType,
boolean isPhysical,
java.lang.String name,
java.lang.CharSequence text,
PsiElement context) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(PsiElementVisitor visitor)
Passes the element to the specified visitor.
|
void |
addImportsFromString(java.lang.String imports)
Adds the specified classes to the list of classes considered to be imported by the
code fragment.
|
protected PsiCodeFragmentImpl |
clone() |
void |
forceResolveScope(GlobalSearchScope scope)
Force search scope for this fragment
|
PsiElement |
getContext()
Returns the element which should be used as the parent of this element in a tree up
walk during a resolve operation.
|
JavaCodeFragment.ExceptionHandler |
getExceptionHandler()
Gets the exception handler which is used to determine which exceptions are considered handled
in the context where the fragment is used.
|
FileType |
getFileType()
Returns the file type for the file.
|
GlobalSearchScope |
getForcedResolveScope() |
IntentionFilterOwner.IntentionActionsFilter |
getIntentionActionsFilter()
Sets the intention actions filter which is used to determine which intention actions should be available in an editor.
|
Language |
getLanguage()
Returns the language of the PSI element.
|
GlobalSearchScope |
getResolveScope()
Returns the scope in which the declarations for the references in this PSI element are searched.
|
PsiType |
getSuperType()
Returns the type corresponding to the
super keyword in the code fragment. |
PsiType |
getThisType()
Returns the type corresponding to the
this keyword in the code fragment. |
FileViewProvider |
getViewProvider() |
JavaCodeFragment.VisibilityChecker |
getVisibilityChecker()
Gets the visibility checker which is used to determine the visibility of declarations
from the code fragment.
|
boolean |
importClass(PsiClass aClass)
Adds an import statement for importing the specified class.
|
java.lang.String |
importsToString()
Returns the list of classes considered to be imported by the code fragment.
|
boolean |
isPhysical()
Checks if an actual source or class file corresponds to the element.
|
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 |
setExceptionHandler(JavaCodeFragment.ExceptionHandler exceptionHandler)
Sets the exception handler which is used to determine which exceptions are considered handled
in the context where the fragment is used.
|
void |
setIntentionActionsFilter(IntentionFilterOwner.IntentionActionsFilter filter)
Sets the intention actions filter which is used to determine which intention actions should be available in an editor.
|
void |
setSuperType(PsiType superType)
Sets the type corresponding to the
super keyword in the code fragment. |
void |
setThisType(PsiType psiType)
Sets the type corresponding to the
this keyword in the code fragment. |
void |
setVisibilityChecker(JavaCodeFragment.VisibilityChecker checker)
Sets the visibility checker which is used to determine the visibility of declarations
from the code fragment.
|
java.lang.String |
toString()
toString() should never be presented to the user.
|
acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, assertReadAccessAllowed, beforeAstChange, calcStubTree, calcTreeElement, canNavigate, canNavigateToSource, checkAdd, checkDelete, checkSetName, clearCaches, cloneImpl, copy, createContentLeafElement, createFileElement, delete, deleteChildRange, derefStub, findChildByClass, findChildrenByClass, findElementAt, findReferenceAt, getChildren, getContainingDirectory, getContainingFile, getContentElementType, getElementTypeForStubBuilder, getFileElementType, getFirstChild, getGreenStub, getGreenStubTree, getLastChild, getManager, getModificationStamp, getName, getNavigationElement, getNextSibling, getNode, getOriginalElement, getOriginalFile, getParent, getPresentation, getPrevSibling, getProject, getPsiRoots, getReference, getReferences, getStartOffsetInParent, getStub, getStubbedSpine, getStubTree, getText, getTextLength, getTextOffset, getTextRange, getTreeElement, getUseScope, getVirtualFile, init, isContentsLoaded, isDirectory, isEquivalentTo, isTemplateDataFile, isValid, isWritable, markInvalidated, navigate, onContentReload, processChildren, putInfo, putInfo, replace, setContentElementType, setName, setOriginalFile, setTreeElementPointer, subtreeChanged, textContains, textMatches, textMatches, textToCharArraybuildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getElementIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, isVisibilitySupported, overlayIcons, registerIconLayer, transformFlagschangeUserMap, clearUserData, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMapequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclearCaches, getContainingDirectory, getFileElementType, getModificationStamp, getNode, getOriginalFile, getParent, getPsiRoots, getVirtualFile, subtreeChangedgetName, isDirectory, processChildrencheckSetNamesetNamegetPresentationcanNavigate, canNavigateToSource, navigatepublic PsiCodeFragmentImpl(Project project, IElementType contentElementType, boolean isPhysical, java.lang.String name, java.lang.CharSequence text, PsiElement context)
public Language getLanguage()
PsiElementgetLanguage in interface PsiElementgetLanguage in class PsiFileImplprotected PsiCodeFragmentImpl clone()
clone in class PsiFileImplpublic FileViewProvider getViewProvider()
getViewProvider in interface PsiFilegetViewProvider in class PsiFileImplpublic FileType getFileType()
PsiFilegetFileType in interface PsiFilepublic PsiElement getContext()
PsiElementgetParent(),
but the context can be overridden for some elements like code fragments (see
JavaCodeFragmentFactory.createCodeBlockCodeFragment(String, PsiElement, boolean)).getContext in interface PsiElementgetContext in class PsiFileImplpublic PsiType getThisType()
JavaCodeFragmentthis keyword in the code fragment.getThisType in interface JavaCodeFragmentthis in the fragment.public void setThisType(PsiType psiType)
JavaCodeFragmentthis keyword in the code fragment.setThisType in interface JavaCodeFragmentpsiType - the type of this in the fragment.public PsiType getSuperType()
JavaCodeFragmentsuper keyword in the code fragment.getSuperType in interface JavaCodeFragmentsuper in the fragment.public void setSuperType(PsiType superType)
JavaCodeFragmentsuper keyword in the code fragment.setSuperType in interface JavaCodeFragmentsuperType - the type of super in the fragment.public java.lang.String importsToString()
JavaCodeFragmentimportsToString in interface JavaCodeFragmentpublic void addImportsFromString(java.lang.String imports)
JavaCodeFragmentaddImportsFromString in interface JavaCodeFragmentimports - the comma-separated list of full-qualified names of classes to import.public void setVisibilityChecker(JavaCodeFragment.VisibilityChecker checker)
JavaCodeFragmentsetVisibilityChecker in interface JavaCodeFragmentchecker - the checker instance.public JavaCodeFragment.VisibilityChecker getVisibilityChecker()
JavaCodeFragmentgetVisibilityChecker in interface JavaCodeFragmentpublic boolean isPhysical()
PsiElementPsiDocumentManager.getDocument(PsiFile) returns null for non-physical elements.
Not to be confused with FileViewProvider.isPhysical().isPhysical in interface PsiElementisPhysical in class PsiFileImplpublic void accept(PsiElementVisitor visitor)
PsiElementaccept in interface PsiElementvisitor - the visitor to pass the element to.public boolean processDeclarations(PsiScopeProcessor processor, ResolveState state, PsiElement lastParent, PsiElement place)
PsiElementprocessDeclarations in interface PsiElementprocessDeclarations in class PsiFileImplprocessor - 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 java.lang.String toString()
PsiElementtoString in interface PsiElementtoString in class PsiFileImplpublic boolean importClass(PsiClass aClass)
PsiImportHolderimportClass in interface PsiImportHolderaClass - the class to import.public JavaCodeFragment.ExceptionHandler getExceptionHandler()
JavaCodeFragmentgetExceptionHandler in interface JavaCodeFragmentpublic void setIntentionActionsFilter(IntentionFilterOwner.IntentionActionsFilter filter)
IntentionFilterOwnersetIntentionActionsFilter in interface IntentionFilterOwnerfilter - the intention actions filter instance.public IntentionFilterOwner.IntentionActionsFilter getIntentionActionsFilter()
IntentionFilterOwnergetIntentionActionsFilter in interface IntentionFilterOwnerpublic void forceResolveScope(GlobalSearchScope scope)
PsiCodeFragmentforceResolveScope in interface PsiCodeFragmentscope - Scope to use when resolving references in this contextpublic GlobalSearchScope getForcedResolveScope()
getForcedResolveScope in interface PsiCodeFragmentpublic GlobalSearchScope getResolveScope()
PsiElementgetResolveScope in interface PsiElementgetResolveScope in class PsiFileImplpublic void setExceptionHandler(JavaCodeFragment.ExceptionHandler exceptionHandler)
JavaCodeFragmentsetExceptionHandler in interface JavaCodeFragmentexceptionHandler - the exception handler instance.