public class PsiPatternVariableImpl extends CompositePsiElement implements PsiPatternVariable, Constants
Iconable.IconFlags, Iconable.LastComputedIconJavaElementType.ICodeBlockElementType, JavaElementType.JavaCompositeElementType, JavaElementType.JavaDummyElementType, JavaElementType.TypeTextElementTypeJavaDocElementType.JavaDocCompositeElementType, JavaDocElementType.JavaDocLazyElementTypeourHCEMPTY_ARRAYFLAGS_LOCKED, ICON_PLACEHOLDERARRAY_FACTORY, EMPTY_ARRAYICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITYANNOTATION_BIT_SET, CATCH_SECTION_BIT_SET, CLASS_BIT_SET, CLASS_INITIALIZER_BIT_SET, FIELD_BIT_SET, JAVA_CODE_REFERENCE_BIT_SET, METHOD_BIT_SET, NAME_VALUE_PAIR_BIT_SET, PARAMETER_BIT_SETANNOTATION_MEMBER_VALUE_BIT_SET, ARRAY_DIMENSION_BIT_SET, CLASS_KEYWORD_BIT_SET, EXPRESSION_BIT_SET, FULL_MEMBER_BIT_SET, IMPORT_STATEMENT_BASE_BIT_SET, INTEGER_LITERALS, JAVA_COMMENT_BIT_SET, JAVA_COMMENT_OR_WHITESPACE_BIT_SET, JAVA_MODULE_STATEMENT_BIT_SET, JAVA_PLAIN_COMMENT_BIT_SET, JAVA_STATEMENT_BIT_SET, KEYWORD_BIT_SET, LITERAL_BIT_SET, MEMBER_BIT_SET, MODIFIER_BIT_SET, OPERATION_BIT_SET, PRIMITIVE_TYPE_BIT_SET, REAL_LITERALS, STRING_LITERALS, TEXT_LITERALSABSTRACT_KEYWORD, AND, ANDAND, ANDEQ, ARROW, ASSERT_KEYWORD, ASTERISK, ASTERISKEQ, AT, BOOLEAN_KEYWORD, BREAK_KEYWORD, BYTE_KEYWORD, C_STYLE_COMMENT, CASE_KEYWORD, CATCH_KEYWORD, CHAR_KEYWORD, CHARACTER_LITERAL, CLASS_KEYWORD, COLON, COMMA, CONST_KEYWORD, CONTINUE_KEYWORD, DEFAULT_KEYWORD, DIV, DIVEQ, DO_KEYWORD, DOT, DOUBLE_COLON, DOUBLE_KEYWORD, DOUBLE_LITERAL, ELLIPSIS, ELSE_KEYWORD, END_OF_LINE_COMMENT, ENUM_KEYWORD, EQ, EQEQ, EXCL, EXPORTS_KEYWORD, EXTENDS_KEYWORD, FALSE_KEYWORD, FINAL_KEYWORD, FINALLY_KEYWORD, FLOAT_KEYWORD, FLOAT_LITERAL, FOR_KEYWORD, GE, GOTO_KEYWORD, GT, GTGT, GTGTEQ, GTGTGT, GTGTGTEQ, IDENTIFIER, IF_KEYWORD, IMPLEMENTS_KEYWORD, IMPORT_KEYWORD, INSTANCEOF_KEYWORD, INT_KEYWORD, INTEGER_LITERAL, INTERFACE_KEYWORD, LBRACE, LBRACKET, LE, LONG_KEYWORD, LONG_LITERAL, LPARENTH, LT, LTLT, LTLTEQ, MINUS, MINUSEQ, MINUSMINUS, MODULE_KEYWORD, NATIVE_KEYWORD, NE, NEW_KEYWORD, NULL_KEYWORD, OPEN_KEYWORD, OPENS_KEYWORD, OR, OREQ, OROR, PACKAGE_KEYWORD, PERC, PERCEQ, PLUS, PLUSEQ, PLUSPLUS, PRIVATE_KEYWORD, PROTECTED_KEYWORD, PROVIDES_KEYWORD, PUBLIC_KEYWORD, QUEST, RBRACE, RBRACKET, RECORD_KEYWORD, REQUIRES_KEYWORD, RETURN_KEYWORD, RPARENTH, SEMICOLON, SHORT_KEYWORD, STATIC_KEYWORD, STRICTFP_KEYWORD, STRING_LITERAL, SUPER_KEYWORD, SWITCH_KEYWORD, SYNCHRONIZED_KEYWORD, TEXT_BLOCK_LITERAL, THIS_KEYWORD, THROW_KEYWORD, THROWS_KEYWORD, TILDE, TO_KEYWORD, TRANSIENT_KEYWORD, TRANSITIVE_KEYWORD, TRUE_KEYWORD, TRY_KEYWORD, USES_KEYWORD, VAR_KEYWORD, VOID_KEYWORD, VOLATILE_KEYWORD, WHILE_KEYWORD, WITH_KEYWORD, XOR, XOREQ, YIELD_KEYWORDBAD_CHARACTER, CODE_FRAGMENT, DUMMY_HOLDER, ERROR_ELEMENT, NEW_LINE_INDENT, WHITE_SPACEALL_JAVADOC_TOKENS, DOC_COMMENT_BAD_CHARACTER, DOC_COMMENT_DATA, DOC_COMMENT_END, DOC_COMMENT_LEADING_ASTERISKS, DOC_COMMENT_START, DOC_INLINE_TAG_END, DOC_INLINE_TAG_START, DOC_SPACE, DOC_TAG_NAME, DOC_TAG_VALUE_COMMA, DOC_TAG_VALUE_DOT, DOC_TAG_VALUE_GT, DOC_TAG_VALUE_LPAREN, DOC_TAG_VALUE_LT, DOC_TAG_VALUE_RPAREN, DOC_TAG_VALUE_SHARP_TOKEN, DOC_TAG_VALUE_TOKENANNOTATION, ANNOTATION_ARRAY_INITIALIZER, ANNOTATION_METHOD, ANNOTATION_PARAMETER_LIST, ANONYMOUS_CLASS, ARRAY_ACCESS_EXPRESSION, ARRAY_INITIALIZER_EXPRESSION, ASSERT_STATEMENT, ASSIGNMENT_EXPRESSION, BINARY_EXPRESSION, BLOCK_STATEMENT, BREAK_STATEMENT, CATCH_SECTION, CLASS, CLASS_INITIALIZER, CLASS_OBJECT_ACCESS_EXPRESSION, CODE_BLOCK, CONDITIONAL_EXPRESSION, CONTINUE_STATEMENT, DECLARATION_STATEMENT, DIAMOND_TYPE, DO_WHILE_STATEMENT, DUMMY_ELEMENT, EMPTY_EXPRESSION, EMPTY_STATEMENT, ENUM_CONSTANT, ENUM_CONSTANT_INITIALIZER, EXPORTS_STATEMENT, EXPRESSION_LIST, EXPRESSION_LIST_STATEMENT, EXPRESSION_STATEMENT, EXPRESSION_TEXT, EXTENDS_BOUND_LIST, EXTENDS_LIST, FIELD, FOR_STATEMENT, FOREACH_STATEMENT, IF_STATEMENT, IMPLEMENTS_LIST, IMPORT_LIST, IMPORT_STATEMENT, IMPORT_STATIC_REFERENCE, IMPORT_STATIC_STATEMENT, INSTANCE_OF_EXPRESSION, JAVA_CODE_REFERENCE, LABELED_STATEMENT, LAMBDA_EXPRESSION, LITERAL_EXPRESSION, LOCAL_VARIABLE, MEMBERS, METHOD, METHOD_CALL_EXPRESSION, METHOD_REF_EXPRESSION, MODIFIER_LIST, MODULE, MODULE_REFERENCE, NAME_VALUE_PAIR, NEW_EXPRESSION, OPENS_STATEMENT, PACKAGE_STATEMENT, PARAMETER, PARAMETER_LIST, PARENTH_EXPRESSION, PATTERN_VARIABLE, POLYADIC_EXPRESSION, POSTFIX_EXPRESSION, PREFIX_EXPRESSION, PROVIDES_STATEMENT, PROVIDES_WITH_LIST, RECEIVER_PARAMETER, RECORD_COMPONENT, RECORD_HEADER, REFERENCE_EXPRESSION, REFERENCE_PARAMETER_LIST, REFERENCE_TEXT, REQUIRES_STATEMENT, RESOURCE_EXPRESSION, RESOURCE_LIST, RESOURCE_VARIABLE, RETURN_STATEMENT, STATEMENTS, SUPER_EXPRESSION, SWITCH_EXPRESSION, SWITCH_LABEL_STATEMENT, SWITCH_LABELED_RULE, SWITCH_STATEMENT, SYNCHRONIZED_STATEMENT, THIS_EXPRESSION, THROW_STATEMENT, THROWS_LIST, TRY_STATEMENT, TYPE, TYPE_CAST_EXPRESSION, TYPE_PARAMETER, TYPE_PARAMETER_LIST, TYPE_TEST_PATTERN, TYPE_WITH_CONJUNCTIONS_TEXT, TYPE_WITH_DISJUNCTIONS_TEXT, USES_STATEMENT, WHILE_STATEMENT, YIELD_STATEMENTALL_JAVADOC_ELEMENTS, DOC_COMMENT, DOC_INLINE_TAG, DOC_METHOD_OR_FIELD_REF, DOC_PARAMETER_REF, DOC_REFERENCE_HOLDER, DOC_TAG, DOC_TAG_VALUE_ELEMENT, DOC_TYPE_HOLDEREMPTY_NAVIGATION_ITEM_ARRAY| Constructor and Description |
|---|
PsiPatternVariableImpl() |
| 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.
|
void |
delete()
Deletes this PSI element from the tree.
|
PsiElement |
getDeclarationScope()
Returns the element (method, lambda expression, foreach statement or catch block) in which the
parameter is declared.
|
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.
|
PsiPattern |
getPattern() |
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.
|
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.
|
void |
normalizeDeclaration()
Ensures that the variable declaration is not combined in the same statement with
other declarations.
|
void |
setInitializer(PsiExpression initializer)
Adds initializer to the variable declaration statement or, if
initializer
parameter is null, removes initializer from variable. |
PsiIdentifier |
setName(java.lang.String name)
Renames the element.
|
java.lang.String |
toString()
toString() should never be presented to the user.
|
acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, canNavigate, canNavigateToSource, checkAdd, checkDelete, clone, copy, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getContext, getFirstChild, getLanguage, getLastChild, getNavigationElement, getNextSibling, getNode, getOriginalElement, getParent, getPresentation, getPrevSibling, getProject, getReference, getReferences, getResolveScope, isEquivalentTo, isPhysical, isValid, isWritable, navigate, processDeclarations, replaceacceptTree, addChild, addChild, addChildren, addInternal, addLeaf, clearCaches, countChildren, createPsiNoLock, deleteChildInternal, findChildByRole, findChildByRoleAsPsiElement, findChildByType, findChildByType, findChildByType, findChildByType, findLeafElementAt, findPsiChildByType, findPsiChildByType, getCachedLength, getChars, getChildren, getChildrenAsPsiElements, getChildrenAsPsiElements, getChildRole, getChildRole, getFirstChildNode, getLastChildNode, getPsi, getPsi, getText, getTextLength, hc, rawAddChildren, rawAddChildrenWithoutNotifications, rawFirstChild, rawLastChild, rawRemoveAllChildren, removeAllChildren, removeChild, removeRange, replaceAllChildrenToChildrenOf, replaceChild, replaceChildInternal, setPsi, subtreeChanged, textContains, textMatches, textToCharArraycopyElement, equals, getElementType, getManager, getStartOffset, getStartOffsetInParent, getTextRange, getTreeNext, getTreeParent, getTreePrev, invalidate, onInvalidated, rawInsertAfterMe, rawInsertBeforeMe, rawRemove, rawRemoveUpTo, rawRemoveUpToLast, rawReplaceWithList, textMatches, 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, waitgetAnnotationsgetIdentifyingElementacceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getContext, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNavigationElement, getNextSibling, getNode, getOriginalElement, getOwnReferences, getParent, getPrevSibling, getProject, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextRange, getTextRangeInParent, isEquivalentTo, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArraygetUserData, putUserDatagetNavigationElementisWritablecanNavigate, canNavigateToSource, navigateacceptgetAnnotation, getSourceElement, hasAnnotation, hasModifiergetCopyableUserData, putCopyableUserDatapublic PsiIdentifier setName(java.lang.String name) throws IncorrectOperationException
PsiNamedElementsetName in interface PomRenameableTarget<PsiElement>setName in interface PsiNamedElementsetName in interface PsiVariablename - 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 PsiIdentifier getNameIdentifier()
PsiVariablegetNameIdentifier in interface PsiNameIdentifierOwnergetNameIdentifier in interface PsiPatternVariablegetNameIdentifier in interface PsiVariablepublic void accept(PsiElementVisitor visitor)
PsiElementaccept in interface PsiElementaccept in class CompositePsiElementvisitor - the visitor to pass the element to.public PsiPattern getPattern()
getPattern in interface PsiPatternVariablepublic void setInitializer(PsiExpression initializer) throws IncorrectOperationException
PsiVariableinitializer
parameter is null, removes initializer from variable.setInitializer in interface PsiVariableinitializer - the initializer to add.IncorrectOperationException - if the modifications fails, or if this variable does not support initializers (e.g. parameters).public void normalizeDeclaration()
throws IncorrectOperationException
PsiVariableint[] a)
and not in C style (int a[]).normalizeDeclaration in interface PsiVariableIncorrectOperationException - if the modification fails for some reason.public java.lang.Object computeConstantValue()
PsiVariablecomputeConstantValue in interface PsiVariablepublic PsiType getType()
PsiVariablegetType in interface JvmParametergetType in interface PsiParametergetType in interface PsiVariableParameter.getParameterizedType(),
Parameter.getAnnotatedType()public PsiElement getDeclarationScope()
PsiParametergetDeclarationScope in interface PsiParameterpublic boolean isVarArgs()
PsiParameterisVarArgs in interface PsiParameterpublic PsiTypeElement getTypeElement()
PsiParametergetTypeElement in interface PsiParametergetTypeElement in interface PsiPatternVariablegetTypeElement in interface PsiVariablepublic PsiExpression getInitializer()
PsiVariablegetInitializer in interface PsiVariablePsiVariable.hasInitializer()public boolean hasInitializer()
PsiVariableChecks 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 PsiVariablepublic java.lang.String getName()
PsiNamedElementgetName in interface JvmNamedElementgetName in interface NavigationItemgetName in interface PomNamedTargetgetName in interface PsiNamedElementgetName in interface PsiParametergetName in interface PsiPatternVariablegetName in class CompositePsiElementpublic int getTextOffset()
PsiElementPsiNamedElement, this should return the offset in the file of the
name identifier.)getTextOffset in interface PsiElementgetTextOffset in class TreeElementpublic PsiModifierList getModifierList()
PsiModifierListOwnergetModifierList in interface PsiModifierListOwnerpublic boolean hasModifierProperty(java.lang.String name)
PsiModifierListOwnerPsiModifier class.hasModifierProperty in interface PsiModifierListOwnername - the name of the modifier to check.public SearchScope getUseScope()
PsiElementgetUseScope in interface PsiElementgetUseScope in class CompositePsiElementPsiSearchHelper.getUseScope(PsiElement)public void delete()
throws IncorrectOperationException
PsiElementdelete in interface PsiElementdelete in class CompositePsiElementIncorrectOperationException - if the modification is not supported
or not possible for some reason (for example, the file containing the element is read-only).public java.lang.String toString()
PsiElementtoString in interface PsiElementtoString in class CompositePsiElement