public class PsiIfStatementImpl extends CompositePsiElement implements PsiIfStatement, Constants
Iconable.IconFlags, Iconable.LastComputedIcon
JavaElementType.ICodeBlockElementType, JavaElementType.JavaCompositeElementType, JavaElementType.JavaDummyElementType, JavaElementType.TypeTextElementType
JavaDocElementType.JavaDocCompositeElementType, JavaDocElementType.JavaDocLazyElementType
ourHC
EMPTY_ARRAY
FLAGS_LOCKED, ICON_PLACEHOLDER
ARRAY_FACTORY, EMPTY_ARRAY
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
ANNOTATION_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_SET
ANNOTATION_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_LITERALS
ABSTRACT_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_KEYWORD
BAD_CHARACTER, CODE_FRAGMENT, DUMMY_HOLDER, ERROR_ELEMENT, NEW_LINE_INDENT, WHITE_SPACE
ALL_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_TOKEN
ANNOTATION, 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_STATEMENT
ALL_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_HOLDER
EMPTY_NAVIGATION_ITEM_ARRAY
Constructor and Description |
---|
PsiIfStatementImpl() |
Modifier and Type | Method and Description |
---|---|
void |
accept(PsiElementVisitor visitor)
Passes the element to the specified visitor.
|
void |
deleteChildInternal(ASTNode child) |
ASTNode |
findChildByRole(int role) |
int |
getChildRole(ASTNode child) |
PsiExpression |
getCondition()
Returns the expression representing the condition of the statement.
|
PsiStatement |
getElseBranch()
Returns the statement which is executed when the condition is true.
|
PsiKeyword |
getElseElement()
Returns the
else keyword of the statement. |
PsiJavaToken |
getLParenth()
Returns the opening parenthesis enclosing the statement condition.
|
PsiJavaToken |
getRParenth()
Returns the closing parenthesis enclosing the statement condition.
|
PsiStatement |
getThenBranch()
Returns the statement which is executed when the condition is true.
|
boolean |
processDeclarations(PsiScopeProcessor processor,
ResolveState state,
PsiElement lastParent,
PsiElement place)
Passes the declarations contained in this PSI element and its children
for processing to the specified scope processor.
|
void |
setElseBranch(PsiStatement statement)
Sets the statement which is executed when the condition is false to the specified value.
|
void |
setThenBranch(PsiStatement statement)
Sets the statement which is executed when the condition is true to the specified value.
|
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, delete, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getContext, getFirstChild, getLanguage, getLastChild, getName, getNavigationElement, getNextSibling, getNode, getOriginalElement, getParent, getPresentation, getPrevSibling, getProject, getReference, getReferences, getResolveScope, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, navigate, replace
acceptTree, addChild, addChild, addChildren, addInternal, addLeaf, clearCaches, countChildren, createPsiNoLock, findChildByRoleAsPsiElement, findChildByType, findChildByType, findChildByType, findChildByType, findLeafElementAt, findPsiChildByType, findPsiChildByType, getCachedLength, getChars, getChildren, getChildrenAsPsiElements, getChildrenAsPsiElements, getChildRole, getFirstChildNode, getLastChildNode, getPsi, getPsi, getText, getTextLength, hc, rawAddChildren, rawAddChildrenWithoutNotifications, rawFirstChild, rawLastChild, rawRemoveAllChildren, removeAllChildren, removeChild, removeRange, replaceAllChildrenToChildrenOf, replaceChild, replaceChildInternal, setPsi, subtreeChanged, textContains, textMatches, textToCharArray
copyElement, equals, getElementType, getManager, getStartOffset, getStartOffsetInParent, getTextOffset, getTextRange, getTreeNext, getTreeParent, getTreePrev, invalidate, onInvalidated, rawInsertAfterMe, rawInsertBeforeMe, rawRemove, rawRemoveUpTo, rawRemoveUpToLast, rawReplaceWithList, textMatches, textMatches, textMatches
buildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getElementIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, isVisibilitySupported, overlayIcons, registerIconLayer, transformFlags
changeUserMap, clearUserData, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
acceptChildren, 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, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray
getUserData, putUserData
getCopyableUserData, putCopyableUserData
public PsiExpression getCondition()
PsiIfStatement
getCondition
in interface PsiIfStatement
public void deleteChildInternal(ASTNode child)
deleteChildInternal
in class CompositeElement
public PsiStatement getThenBranch()
PsiIfStatement
getThenBranch
in interface PsiIfStatement
public PsiStatement getElseBranch()
PsiIfStatement
getElseBranch
in interface PsiIfStatement
else
part or is incomplete.public PsiJavaToken getLParenth()
PsiIfStatement
getLParenth
in interface PsiIfStatement
public PsiJavaToken getRParenth()
PsiIfStatement
getRParenth
in interface PsiIfStatement
public PsiKeyword getElseElement()
PsiIfStatement
else
keyword of the statement.getElseElement
in interface PsiIfStatement
else
part.public void setElseBranch(PsiStatement statement) throws IncorrectOperationException
PsiIfStatement
else
keyword if required.setElseBranch
in interface PsiIfStatement
statement
- the statement to use as the else branch.IncorrectOperationException
- if the modification fails for some reason (for example,
the containing file is read-only).public void setThenBranch(PsiStatement statement) throws IncorrectOperationException
PsiIfStatement
setThenBranch
in interface PsiIfStatement
statement
- the statement to use as the then branch.IncorrectOperationException
- if the modification fails for some reason (for example,
the containing file is read-only).public ASTNode findChildByRole(int role)
findChildByRole
in class CompositeElement
public int getChildRole(ASTNode child)
getChildRole
in class CompositeElement
public void accept(PsiElementVisitor visitor)
PsiElement
accept
in interface PsiElement
accept
in class CompositePsiElement
visitor
- the visitor to pass the element to.public boolean processDeclarations(PsiScopeProcessor processor, ResolveState state, PsiElement lastParent, PsiElement place)
PsiElement
processDeclarations
in interface PsiElement
processDeclarations
in class CompositePsiElement
processor
- the processor receiving the declarations.lastParent
- the child of this element has been processed during the previous
step of the tree up walk (declarations under this element do not need
to be processed again)place
- the original element from which the tree up walk was initiated.public java.lang.String toString()
PsiElement
toString
in interface PsiElement
toString
in class CompositePsiElement