Module jdk.compiler

Interface TryTree

所有超级接口:
StatementTree, Tree

public interface TryTree extends StatementTree
用于try语句的树节点。例如:
   try
       block
   catches
   finally
       finallyBlock
 
参见 Java语言规范:
14.20 try语句
自Java版本:
1.6
  • Nested Class Summary

    Nested classes/interfaces declared in interface com.sun.source.tree.Tree

    Tree.Kind
  • Method Summary

    Modifier and Type
    Method
    Description
    返回try语句的块。
    List<? extends CatchTree>
    返回try语句中提供的任何catch块。
    返回try语句中提供的finally块,如果没有则返回null
    List<? extends Tree>
    返回try语句中提供的任何资源声明。

    Methods declared in interface com.sun.source.tree.Tree

    accept, getKind
  • Method Details

    • getBlock

      BlockTree getBlock()
      返回try语句的块。
      返回:
      该块
    • getCatches

      List<? extends CatchTree> getCatches()
      返回try语句中提供的任何catch块。如果没有catch块,则结果将是一个空列表。
      返回:
      catch块
    • getFinallyBlock

      BlockTree getFinallyBlock()
      返回try语句中提供的finally块,如果没有则返回null
      返回:
      finally块
    • getResources

      List<? extends Tree> getResources()
      返回try语句中提供的任何资源声明。如果没有资源声明,则结果将是一个空列表。
      返回:
      资源声明