public class PsiLiteralExpressionImpl extends JavaStubPsiElement<PsiLiteralStub> implements PsiLiteralExpression, PsiLanguageInjectionHost, ContributedReferenceHost
Iconable.IconFlags, Iconable.LastComputedIcon
PsiLanguageInjectionHost.InjectedPsiVisitor, PsiLanguageInjectionHost.Shred
CREATION_TRACE, ourTraceStubAstBinding
FLAGS_LOCKED, ICON_PLACEHOLDER
ARRAY_FACTORY, EMPTY_ARRAY, EXPRESSION_TO_TYPE
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
EMPTY_NAVIGATABLE_ELEMENT_ARRAY
EMPTY_NAVIGATION_ITEM_ARRAY
Constructor and Description |
---|
PsiLiteralExpressionImpl(ASTNode node) |
PsiLiteralExpressionImpl(PsiLiteralStub stub) |
Modifier and Type | Method and Description |
---|---|
void |
accept(PsiElementVisitor visitor)
Passes the element to the specified visitor.
|
LiteralTextEscaper<PsiLiteralExpressionImpl> |
createLiteralTextEscaper() |
java.lang.String |
getCanonicalText() |
PsiElement [] |
getChildren()
Returns the array of children for the PSI element.
|
java.lang.String |
getInnerText() |
IElementType |
getLiteralElementType() |
PsiReference [] |
getReferences()
Returns all references from this PSI element to other PSI elements.
|
java.lang.String |
getText()
Returns the text of the PSI element.
|
int |
getTextBlockIndent() |
java.lang.String [] |
getTextBlockLines() |
java.lang.String |
getTextBlockText() |
PsiType |
getType()
Returns the type of the expression.
|
java.lang.Object |
getValue()
Returns the value of the literal expression (an Integer for an integer constant, a String
for a string literal, and so on).
|
boolean |
isValidHost() |
static boolean |
parseStringCharacters(java.lang.String chars,
java.lang.StringBuilder outChars,
int [] sourceOffsets) |
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, calcTreeElement, checkAdd, clone, cloneImpl, delete, deleteChildRange, getLanguage, getTextOffset, replace
getContainingFile, getContext, getElementType, getGreenStub, getManager, getNode, getParent, getParentByStub, getParentByTree, getProject, getRequiredStubOrPsiChild, getStub, getStubOrPsiChild, getStubOrPsiChildren, getStubOrPsiChildren, getStubOrPsiChildren, getStubOrPsiChildren, getStubOrPsiParentOfType, isPhysical, isValid, isWritable, setNode, setSubstrateRef
addInternal, addRange, addRangeAfter, addRangeBefore, checkDelete, copy, deleteChildInternal, findChildByFilter, findChildByType, findChildByType, findChildrenByType, findChildrenByType, findChildrenByType, findChildrenByType, findElementAt, findLastChildByType, findNotNullChildByType, findNotNullChildByType, getCopyableUserData, getFirstChild, getLastChild, getNextSibling, getPrevSibling, getStartOffsetInParent, getTextLength, getTextRange, putCopyableUserData, replaceChildInternal, subtreeChanged, textContains, textMatches, textToCharArray
canNavigate, canNavigateToSource, findChildByClass, findChildrenByClass, findNotNullChildByClass, findReferenceAt, getName, getNavigationElement, getOriginalElement, getPresentation, getReference, getResolveScope, getUseScope, isEquivalentTo, navigate, notNullChild, processDeclarations, textMatches
buildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getElementIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, isVisibilitySupported, overlayIcons, registerIconLayer, transformFlags
changeUserMap, clearUserData, copyCopyableDataTo, copyUserDataTo, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putUserData, putUserDataIfAbsent, replace, setUserMap
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getContainingFile, getContext, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNavigationElement, getNextSibling, getNode, getOriginalElement, getOwnReferences, getParent, getPrevSibling, getProject, getReference, getResolveScope, getStartOffsetInParent, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray
getUserData, putUserData
getElementType, getStub
public PsiLiteralExpressionImpl(PsiLiteralStub stub)
public PsiLiteralExpressionImpl(ASTNode node)
public PsiElement [] getChildren()
PsiElement
getChildren
in interface PsiElement
getChildren
in class JavaStubPsiElement<PsiLiteralStub>
public PsiType getType()
PsiExpression
getType
in interface PsiExpression
public IElementType getLiteralElementType()
public java.lang.String getCanonicalText()
public java.lang.String getText()
PsiElement
getText
in interface PsiElement
getText
in class ASTDelegatePsiElement
PsiElement.textMatches(java.lang.CharSequence)
,
PsiElement.textContains(char)
public java.lang.Object getValue()
PsiLiteralValue
getValue
in interface PsiLiteralValue
public java.lang.String getInnerText()
public java.lang.String getTextBlockText()
public int getTextBlockIndent()
public java.lang.String [] getTextBlockLines()
public static boolean parseStringCharacters(java.lang.String chars, java.lang.StringBuilder outChars, int [] sourceOffsets)
public void accept(PsiElementVisitor visitor)
PsiElement
accept
in interface PsiElement
accept
in class PsiElementBase
visitor
- the visitor to pass the element to.public java.lang.String toString()
PsiElement
toString
in interface PsiElement
toString
in class java.lang.Object
public boolean isValidHost()
isValidHost
in interface PsiLanguageInjectionHost
true
if this instance can accept injections, false
otherwisepublic PsiReference [] getReferences()
PsiElement
PsiPolyVariantReference
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 ContributedReferenceHost
getReferences
in interface PsiElement
getReferences
in class PsiElementBase
PsiReferenceService.getReferences(com.intellij.psi.PsiElement, com.intellij.psi.PsiReferenceService.Hints)
,
ReferencesSearch
public PsiLanguageInjectionHost updateText(java.lang.String text)
PsiLanguageInjectionHost
text
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 PsiLanguageInjectionHost
text
- text of the injected filepublic LiteralTextEscaper<PsiLiteralExpressionImpl> createLiteralTextEscaper()
createLiteralTextEscaper
in interface PsiLanguageInjectionHost
LiteralTextEscaper
instance which will be used to convert the content of this host element to the content of injected file