Package org.sonar.python.tree
Class IfStatementImpl
- java.lang.Object
-
- org.sonar.python.tree.PyTree
-
- org.sonar.python.tree.IfStatementImpl
-
- All Implemented Interfaces:
IfStatement,Statement,Tree
public class IfStatementImpl extends PyTree implements IfStatement
-
-
Field Summary
-
Fields inherited from class org.sonar.python.tree.PyTree
firstToken, lastToken
-
-
Constructor Summary
Constructors Constructor Description IfStatementImpl(Token elifKeyword, Expression condition, Token colon, Token newLine, Token indent, StatementList statements, Token dedent)Elif statement constructorIfStatementImpl(Token ifKeyword, Expression condition, Token colon, Token newLine, Token indent, StatementList statements, Token dedent, List<IfStatement> elifBranches, ElseClause elseClause)If statement constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(TreeVisitor visitor)StatementListbody()List<Tree>computeChildren()Expressioncondition()List<IfStatement>elifBranches()ElseClauseelseBranch()Tree.KindgetKind()booleanisElif()Tokenkeyword()-
Methods inherited from class org.sonar.python.tree.PyTree
children, firstToken, is, lastToken, parent, setParent
-
-
-
-
Constructor Detail
-
IfStatementImpl
public IfStatementImpl(Token ifKeyword, Expression condition, Token colon, @CheckForNull Token newLine, @CheckForNull Token indent, StatementList statements, @CheckForNull Token dedent, List<IfStatement> elifBranches, @CheckForNull ElseClause elseClause)
If statement constructor
-
IfStatementImpl
public IfStatementImpl(Token elifKeyword, Expression condition, Token colon, @CheckForNull Token newLine, @CheckForNull Token indent, StatementList statements, @CheckForNull Token dedent)
Elif statement constructor
-
-
Method Detail
-
keyword
public Token keyword()
- Specified by:
keywordin interfaceIfStatement
-
condition
public Expression condition()
- Specified by:
conditionin interfaceIfStatement
-
body
public StatementList body()
- Specified by:
bodyin interfaceIfStatement
-
elifBranches
public List<IfStatement> elifBranches()
- Specified by:
elifBranchesin interfaceIfStatement
-
isElif
public boolean isElif()
- Specified by:
isElifin interfaceIfStatement
-
elseBranch
@CheckForNull public ElseClause elseBranch()
- Specified by:
elseBranchin interfaceIfStatement
-
accept
public void accept(TreeVisitor visitor)
-
-