IfTree (Compiler Tree API )
Keywords: com.sun.source.tree.IfTree interface
Date: 2020-03-26

com.sun.source.tree

## Interface IfTree

- All Superinterfaces:
    StatementTree, Tree

      @Exported
      public interface IfTree
      extends StatementTree

  A tree node for an 'if' statement. For example:

         if ( condition )
            thenStatement

         if ( condition )
             thenStatement
         else
             elseStatement

  Since:
    1.6
  See The Java™ Language Specification:
    section 14.9

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.sun.source.tree.Tree

      `Tree.Kind`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ExpressionTree` | `getCondition()`
    `StatementTree` | `getElseStatement()`
    `StatementTree` | `getThenStatement()`

    - ### Methods inherited from interface com.sun.source.tree.Tree

      `accept, getKind`

- - ### Method Detail

    - #### getCondition

          ExpressionTree getCondition()

    - #### getThenStatement

          StatementTree getThenStatement()

    - #### getElseStatement

          StatementTree getElseStatement()

      Returns:
        null if this if statement has no else branch.

Copyright © 2005, 2020, Oracle and/or its affiliates. All rights reserved.