public class PsiCommentImpl extends LeafPsiElement implements PsiComment, PsiLanguageInjectionHost
PsiLanguageInjectionHost.InjectedPsiVisitor, PsiLanguageInjectionHost.ShredIconable.IconFlags, Iconable.LastComputedIconEMPTY_ARRAYFLAGS_LOCKED, ICON_PLACEHOLDERARRAY_FACTORY, EMPTY_ARRAYICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITYEMPTY_NAVIGATION_ITEM_ARRAY| Constructor and Description |
|---|
PsiCommentImpl(IElementType type,
java.lang.CharSequence text) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(PsiElementVisitor visitor)
Passes the element to the specified visitor.
|
LiteralTextEscaper<PsiCommentImpl> |
createLiteralTextEscaper() |
PsiReference [] |
getReferences()
Returns all references from this PSI element to other PSI elements.
|
IElementType |
getTokenType()
Returns the token type of the comment (like
JavaTokenType.END_OF_LINE_COMMENT or JavaTokenType.C_STYLE_COMMENT). |
boolean |
isValidHost() |
java.lang.String |
toString()
toString() should never be presented to the user.
|
PsiLanguageInjectionHost |
updateText(java.lang.String text)
Update the host element using the provided text of the injected file.
|
acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, canNavigate, canNavigateToSource, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getContext, getFirstChild, getLanguage, getLastChild, getName, getNavigationElement, getNextSibling, getNode, getOriginalElement, getParent, getPresentation, getPrevSibling, getProject, getPsi, getReference, getResolveScope, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, navigate, processDeclarations, replaceacceptTree, addChild, addChild, addChildren, addLeaf, charAt, clone, copyTo, findChildByType, findChildByType, findChildByType, findChildByType, findLeafElementAt, getCachedLength, getChars, getChildren, getFirstChildNode, getLastChildNode, getPsi, getText, getTextLength, hc, rawReplaceWithText, removeChild, removeRange, replaceAllChildrenToChildrenOf, replaceChild, replaceWithText, textContains, textMatches, textMatches, textToCharArrayclearCaches, copyElement, equals, getElementType, getManager, getStartOffset, getStartOffsetInParent, getTextOffset, getTextRange, getTreeNext, getTreeParent, getTreePrev, invalidate, onInvalidated, rawInsertAfterMe, rawInsertBeforeMe, rawRemove, rawRemoveUpTo, rawRemoveUpToLast, rawReplaceWithList, textMatches, textMatchesbuildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getElementIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, isVisibilitySupported, overlayIcons, registerIconLayer, transformFlagschangeUserMap, clearUserData, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMapfinalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getContext, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNavigationElement, getNextSibling, getNode, getOriginalElement, getOwnReferences, getParent, getPrevSibling, getProject, getReference, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArraygetUserData, putUserDatagetCopyableUserData, putCopyableUserDatapublic PsiCommentImpl(IElementType type, java.lang.CharSequence text)
public IElementType getTokenType()
PsiCommentJavaTokenType.END_OF_LINE_COMMENT or JavaTokenType.C_STYLE_COMMENT).getTokenType in interface PsiCommentpublic void accept(PsiElementVisitor visitor)
PsiElementaccept in interface PsiElementaccept in class LeafPsiElementvisitor - the visitor to pass the element to.public java.lang.String toString()
PsiElementtoString in interface PsiElementtoString in class LeafPsiElementpublic PsiReference [] getReferences()
PsiElementPsiPolyVariantReference should be used instead
of returning multiple references.
Actually, it's preferable to call PsiReferenceService.getReferences(com.intellij.psi.PsiElement, com.intellij.psi.PsiReferenceService.Hints) instead
as it allows adding references by plugins when the element implements ContributedReferenceHost.getReferences in interface PsiElementgetReferences in class LeafPsiElementPsiReferenceService.getReferences(com.intellij.psi.PsiElement, com.intellij.psi.PsiReferenceService.Hints),
ReferencesSearchpublic boolean isValidHost()
isValidHost in interface PsiLanguageInjectionHosttrue if this instance can accept injections, false otherwisepublic PsiLanguageInjectionHost updateText(java.lang.String text)
PsiLanguageInjectionHosttext
in accordance with the host language syntax. The implementation may delegate to ElementManipulators.handleContentChange(PsiElement, String)
if ElementManipulator implementation is registered for this element class.updateText in interface PsiLanguageInjectionHosttext - text of the injected filepublic LiteralTextEscaper<PsiCommentImpl> createLiteralTextEscaper()
createLiteralTextEscaper in interface PsiLanguageInjectionHostLiteralTextEscaper instance which will be used to convert the content of this host element to the content of injected file