public class PsiParameterImpl extends JavaStubPsiElement<PsiParameterStub> implements PsiParameter
Iconable.IconFlags, Iconable.LastComputedIcon
CREATION_TRACE, ourTraceStubAstBinding
FLAGS_LOCKED, ICON_PLACEHOLDER
ARRAY_FACTORY, EMPTY_ARRAY
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
EMPTY_NAVIGATABLE_ELEMENT_ARRAY
EMPTY_NAVIGATION_ITEM_ARRAY
Modifier | Constructor and Description |
---|---|
|
PsiParameterImpl(ASTNode node) |
|
PsiParameterImpl(PsiParameterStub stub) |
protected |
PsiParameterImpl(PsiParameterStub stub,
IStubElementType type) |
Modifier and Type | Method and Description |
---|---|
void |
accept(PsiElementVisitor visitor)
Passes the element to the specified visitor.
|
protected java.lang.Object |
clone() |
java.lang.Object |
computeConstantValue()
Calculates and returns the constant value of the variable initializer.
|
PsiElement |
getDeclarationScope()
Returns the element (method, lambda expression, foreach statement or catch block) in which the
parameter is declared.
|
javax.swing.Icon |
getElementIcon(int flags) |
PsiExpression |
getInitializer()
Returns the initializer for the variable.
|
static PsiType |
getLambdaParameterType(PsiParameter param) |
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.
|
PsiElement |
getOriginalElement()
Returns the PSI element which corresponds to this element and belongs to
either the project source path or class path.
|
ItemPresentation |
getPresentation() |
PsiType |
getType()
Returns the type of the variable.
|
PsiTypeElement |
getTypeElement()
Returns the type element declaring the type of the variable.
|
SearchScope |
getUseScope()
Returns the scope in which references to this element are searched.
|
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 parameter accepts a variable number of arguments.
|
protected boolean |
isVisibilitySupported() |
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.
|
void |
subtreeChanged() |
java.lang.String |
toString()
toString() should never be presented to the user.
|
acceptChildren, add, addAfter, addBefore, calcTreeElement, checkAdd, cloneImpl, delete, deleteChildRange, getChildren, getLanguage, getTextOffset, 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, textContains, textMatches, textToCharArray
canNavigate, canNavigateToSource, findChildByClass, findChildrenByClass, findNotNullChildByClass, findReferenceAt, getNavigationElement, getReference, getReferences, getResolveScope, isEquivalentTo, navigate, notNullChild, processDeclarations, textMatches
buildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, overlayIcons, registerIconLayer, transformFlags
changeUserMap, clearUserData, copyCopyableDataTo, copyUserDataTo, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putUserData, putUserDataIfAbsent, replace, setUserMap
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAnnotations
setInitializer
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, getOwnReferences, getParent, getPrevSibling, getProject, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, isEquivalentTo, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray
getUserData, putUserData
getNavigationElement
isWritable
canNavigate, canNavigateToSource, navigate
accept
getAnnotation, getSourceElement, hasAnnotation, hasModifier
getElementType, getStub
public PsiParameterImpl(PsiParameterStub stub)
protected PsiParameterImpl(PsiParameterStub stub, IStubElementType type)
public PsiParameterImpl(ASTNode node)
public static PsiType getLambdaParameterType(PsiParameter param)
public void subtreeChanged()
subtreeChanged
in class ASTDelegatePsiElement
protected java.lang.Object clone()
clone
in class JavaStubPsiElement<PsiParameterStub>
public final java.lang.String getName()
PsiNamedElement
getName
in interface JvmNamedElement
getName
in interface NavigationItem
getName
in interface PomNamedTarget
getName
in interface PsiNamedElement
getName
in interface PsiParameter
getName
in class PsiElementBase
public final 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 final PsiIdentifier getNameIdentifier()
PsiVariable
getNameIdentifier
in interface PsiNameIdentifierOwner
getNameIdentifier
in interface PsiVariable
public CompositeElement getNode()
StubBasedPsiElementBase
getNode
in interface PsiElement
getNode
in class StubBasedPsiElementBase<PsiParameterStub>
StubBasedPsiElementBase.getStub()
will return null.public PsiType getType()
PsiVariable
getType
in interface JvmParameter
getType
in interface PsiParameter
getType
in interface PsiVariable
Parameter.getParameterizedType()
,
Parameter.getAnnotatedType()
public PsiTypeElement getTypeElement()
PsiParameter
getTypeElement
in interface PsiParameter
getTypeElement
in interface PsiVariable
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 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 java.lang.Object computeConstantValue()
PsiVariable
computeConstantValue
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 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 PsiElement getDeclarationScope()
PsiParameter
getDeclarationScope
in interface PsiParameter
public boolean isVarArgs()
PsiParameter
isVarArgs
in interface PsiParameter
public ItemPresentation getPresentation()
getPresentation
in interface NavigationItem
getPresentation
in class PsiElementBase
public javax.swing.Icon getElementIcon(int flags)
getElementIcon
in class ElementBase
protected boolean isVisibilitySupported()
isVisibilitySupported
in class ElementBase
public SearchScope getUseScope()
PsiElement
getUseScope
in interface PsiElement
getUseScope
in class PsiElementBase
PsiSearchHelper.getUseScope(PsiElement)
public PsiElement getOriginalElement()
PsiElement
this
or substitute a different element if this element does
not belong to the source path or class path. (For example, the original
element for a library source file is the corresponding compiled class file.)getOriginalElement
in interface PsiElement
getOriginalElement
in class PsiElementBase