Interface TryTree

All Superinterfaces:
StatementTree, Tree

public interface TryTree extends StatementTree
A tree node for a try statement. For example:
   try
       block
   catches
   finally
       finallyBlock
 
See Java Language Specification:
14.20 The try statement
Since:
1.6
  • Nested Class Summary Link icon

    Nested classes/interfaces declared in interface Tree Link icon

    Tree.Kind
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    Returns the block of the try statement.
    List<? extends CatchTree>
    Returns any catch blocks provided in the try statement.
    Returns the finally block provided in the try statement, or null if there is none.
    List<? extends Tree>
    Returns any resource declarations provided in the try statement.

    Methods declared in interface Tree Link icon

    accept, getKind
  • Method Details Link icon

    • getBlock Link icon

      BlockTree getBlock()
      Returns the block of the try statement.
      Returns:
      the block
    • getCatches Link icon

      List<? extends CatchTree> getCatches()
      Returns any catch blocks provided in the try statement. The result will be an empty list if there are no catch blocks.
      Returns:
      the catch blocks
    • getFinallyBlock Link icon

      BlockTree getFinallyBlock()
      Returns the finally block provided in the try statement, or null if there is none.
      Returns:
      the finally block
    • getResources Link icon

      List<? extends Tree> getResources()
      Returns any resource declarations provided in the try statement. The result will be an empty list if there are no resource declarations.
      Returns:
      the resource declarations