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
-
-
Constructor Summary
Constructors Constructor Description IfStatementImpl(Token elifKeyword, Expression condition, StatementList statements)Elif statement constructorIfStatementImpl(Token ifKeyword, Expression condition, StatementList statements, List<IfStatement> elifBranches, ElseStatement elseStatement)If statement constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(TreeVisitor visitor)StatementListbody()List<Tree>children()Expressioncondition()List<IfStatement>elifBranches()ElseStatementelseBranch()Tree.KindgetKind()booleanisElif()Tokenkeyword()-
Methods inherited from class org.sonar.python.tree.PyTree
astNode, firstToken, is, lastToken, parent, setParent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.sonar.python.api.tree.Tree
ancestors, astNode, descendants, descendants, firstToken, is, lastToken, parent
-
-
-
-
Constructor Detail
-
IfStatementImpl
public IfStatementImpl(Token ifKeyword, Expression condition, StatementList statements, List<IfStatement> elifBranches, @CheckForNull ElseStatement elseStatement)
If statement constructor
-
IfStatementImpl
public IfStatementImpl(Token elifKeyword, Expression condition, StatementList statements)
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 ElseStatement elseBranch()
- Specified by:
elseBranchin interfaceIfStatement
-
accept
public void accept(TreeVisitor visitor)
-
-