public class PsiRecordComponentImpl extends JavaStubPsiElement<PsiRecordComponentStub> implements PsiRecordComponent
Iconable.IconFlags, Iconable.LastComputedIcon
CREATION_TRACE, ourTraceStubAstBinding
FLAGS_LOCKED, ICON_PLACEHOLDER
EMPTY_ARRAY
EMPTY_NAVIGATABLE_ELEMENT_ARRAY
EMPTY_NAVIGATION_ITEM_ARRAY
ARRAY_FACTORY
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
Constructor and Description |
---|
PsiRecordComponentImpl(ASTNode node) |
PsiRecordComponentImpl(PsiRecordComponentStub stub) |
Modifier and Type | Method and Description |
---|---|
void |
accept(PsiElementVisitor visitor)
Passes the element to the specified visitor.
|
java.lang.Object |
computeConstantValue()
Calculates and returns the constant value of the variable initializer.
|
PsiClass |
getContainingClass()
Returns the class containing the member.
|
PsiExpression |
getInitializer()
Returns the initializer for the variable.
|
PsiModifierList |
getModifierList()
Returns the list of modifiers for the element.
|
java.lang.String |
getName()
Returns the name of the element.
|
PsiIdentifier |
getNameIdentifier()
Returns the identifier declaring the name of the variable.
|
CompositeElement |
getNode()
Ensures this element is AST-based.
|
int |
getTextOffset()
Returns the offset in the file to which the caret should be placed
when performing the navigation to the element.
|
PsiType |
getType()
Returns the type of the variable.
|
PsiTypeElement |
getTypeElement()
Returns the type element declaring the type of the variable.
|
boolean |
hasInitializer()
Checks if the variable has an initializer.
|
boolean |
hasModifierProperty(java.lang.String name)
Checks if the element has the specified modifier.
|
boolean |
isVarArgs()
Checks if the record component accepts a variable number of arguments in canonical constructor.
|
void |
normalizeDeclaration()
Ensures that the variable declaration is not combined in the same statement with
other declarations.
|
PsiElement |
setName(java.lang.String name)
Renames the element.
|
java.lang.String |
toString()
toString() should never be presented to the user.
|
acceptChildren, add, addAfter, addBefore, calcTreeElement, checkAdd, clone, cloneImpl, delete, deleteChildRange, getChildren, getLanguage, replace
getContainingFile, getContext, getElementType, getGreenStub, getManager, 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, getText, getTextLength, getTextRange, putCopyableUserData, replaceChildInternal, subtreeChanged, textContains, textMatches, textToCharArray
canNavigate, canNavigateToSource, findChildByClass, findChildrenByClass, findNotNullChildByClass, findReferenceAt, getNavigationElement, getOriginalElement, getPresentation, getReference, getReferences, 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
getPresentation
setInitializer
getAnnotation, getAnnotations, hasAnnotation, hasModifier
getIdentifyingElement
acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getContext, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNavigationElement, getNextSibling, getOriginalElement, getOwnReferences, getParent, getPrevSibling, getProject, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextRange, getTextRangeInParent, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray
getUserData, putUserData
getNavigationElement
isWritable
canNavigate, canNavigateToSource, navigate
getElementType, getStub
public PsiRecordComponentImpl(PsiRecordComponentStub stub)
public PsiRecordComponentImpl(ASTNode node)
public void accept(PsiElementVisitor visitor)
PsiElement
accept
in interface PsiElement
accept
in class PsiElementBase
visitor
- the visitor to pass the element to.public PsiClass getContainingClass()
PsiMember
getContainingClass
in interface PsiMember
public PsiModifierList getModifierList()
PsiModifierListOwner
getModifierList
in interface PsiModifierListOwner
public boolean hasModifierProperty(java.lang.String name)
PsiModifierListOwner
PsiModifier
class.hasModifierProperty
in interface PsiModifierListOwner
name
- the name of the modifier to check.public PsiType getType()
PsiVariable
getType
in interface PsiVariable
public PsiTypeElement getTypeElement()
PsiVariable
getTypeElement
in interface PsiVariable
public void normalizeDeclaration() throws IncorrectOperationException
PsiVariable
int[] a
)
and not in C style (int a[]
).normalizeDeclaration
in interface PsiVariable
IncorrectOperationException
- if the modification fails for some reason.public java.lang.Object computeConstantValue()
PsiVariable
computeConstantValue
in interface PsiVariable
public PsiIdentifier getNameIdentifier()
PsiVariable
getNameIdentifier
in interface PsiNameIdentifierOwner
getNameIdentifier
in interface PsiVariable
public int getTextOffset()
PsiElement
PsiNamedElement
, this should return the offset in the file of the
name identifier.)getTextOffset
in interface PsiElement
getTextOffset
in class JavaStubPsiElement<PsiRecordComponentStub>
public PsiElement setName(java.lang.String name) throws IncorrectOperationException
PsiNamedElement
setName
in interface PomRenameableTarget<PsiElement>
setName
in interface PsiNamedElement
setName
in interface PsiVariable
name
- the new element name.this
or a different element if the rename caused the element to be replaced).IncorrectOperationException
- if the modification is not supported or not possible for some reason.public java.lang.String getName()
PsiNamedElement
getName
in interface NavigationItem
getName
in interface PomNamedTarget
getName
in interface PsiNamedElement
getName
in class PsiElementBase
public CompositeElement getNode()
StubBasedPsiElementBase
getNode
in interface PsiElement
getNode
in class StubBasedPsiElementBase<PsiRecordComponentStub>
StubBasedPsiElementBase.getStub()
will return null.public PsiExpression getInitializer()
PsiVariable
getInitializer
in interface PsiVariable
PsiVariable.hasInitializer()
public boolean hasInitializer()
PsiVariable
Checks if the variable has an initializer.
Please note that even when PsiVariable.hasInitializer()
returns true, PsiVariable.getInitializer()
still can return null,
e.g. for implicit initializer in case of enum constant declaration.
hasInitializer
in interface PsiVariable
public boolean isVarArgs()
PsiRecordComponent
isVarArgs
in interface PsiRecordComponent
public java.lang.String toString()
PsiElement
toString
in interface PsiElement
toString
in class java.lang.Object