APIdia Launch Partner
Top Description Methods
com.sun.source.tree

public Interface TryTree

extends StatementTree
Known Direct Implementers
com.sun.tools.javac.tree.JCTree.JCTry
Imports
java.util.List

A tree node for a try statement. For example:
  try
      block
  catches
  finally
      finallyBlock
Authors
Peter von der Ahé, Jonathan Gibbons
Since
1.6
Java Language Specification
14.20 The try statement

Method Summary

Modifier and TypeMethod and Description
public BlockTree

Returns:

the block
getBlock
()

Returns the block of the try statement.

public List<? extends CatchTree>

Returns:

the catch blocks
getCatches
()

Returns any catch blocks provided in the try statement.

public BlockTree

Returns:

the finally block
getFinallyBlock
()

Returns the finally block provided in the try statement, or null if there is none.

public List<? extends Tree>

Returns:

the resource declarations
getResources
()

Returns any resource declarations provided in the try statement.

Method Detail

getBlockback to summary
public BlockTree getBlock()

Returns the block of the try statement.

Returns:BlockTree

the block

getCatchesback to summary
public 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:List<? extends CatchTree>

the catch blocks

getFinallyBlockback to summary
public BlockTree getFinallyBlock()

Returns the finally block provided in the try statement, or null if there is none.

Returns:BlockTree

the finally block

getResourcesback to summary
public 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:List<? extends Tree>

the resource declarations