# Interface: com.pnfsoftware.jeb.core.units.code.java.IJavaTry

Java AST interface to represent try\-catch elements.

## Method: addCatchBlock
- parameter: `index`, type: `int`
- parameter: `type`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaType`
- parameter: `addTypes`, type: `java.util.List<com.pnfsoftware.jeb.core.units.code.java.IJavaType>`
- parameter: `ident`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaIdentifier`
- parameter: `def`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaDefinition`
- parameter: `block`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`

Description: 
parameter: index: 
parameter: type: 
parameter: addTypes: 
parameter: ident: 
parameter: def: 
parameter: block: 

## Method: addCatchBlock
- parameter: `type`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaType`
- parameter: `addTypes`, type: `java.util.List<com.pnfsoftware.jeb.core.units.code.java.IJavaType>`
- parameter: `ident`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaIdentifier`
- parameter: `def`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaDefinition`
- parameter: `block`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`

Description: 
parameter: type: 
parameter: addTypes: 
parameter: ident: 
parameter: def: 
parameter: block: 

## Method: addResourceAcq
- parameter: `exp`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaExpression`

Description: 
parameter: exp: an acquisition expression that will be appended to the current list of acquisition expressions

## Method: addResourceAcq
- parameter: `i`, type: `int`
- parameter: `exp`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaExpression`

Description: 
parameter: i: insertion index
parameter: exp: an acquisition expression that will be added to the current list of acquisition expressions

## Method: duplicate
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaTry`


## Method: getCatchBlock
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaCatchBlock`

Description: 
parameter: index: 
return: 

## Method: getCatchBody
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`

Description: Get a catch body.
parameter: index: 0\-based catch block index
return: the catch body

## Method: getCatchByType
- parameter: `typestring`, type: `java.lang.String`
- return type: `int`

Description: 
parameter: typestring: 
return: 

## Method: getCatchCount
- return type: `int`

Description: Get the number of catch blocks.
return: the number of catch blocks.

## Method: getCatchIdentifier
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaIdentifier`

Description: Get the named identifier associated with the caught exception of a catch block.
parameter: index: 0\-based catch block index
return: the caught exception identifier, may be null if there is none

## Method: getCatchType
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaType`

Description: Get the type of exception caught by a catch block.
parameter: index: 0\-based catch block index
return: the caught exception type

## Method: getFinallyBlock
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`

Description: Get the finally block, if there is one.
return: the finally block, null if there is none

## Method: getResourceAcqs
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.java.IJavaExpression>`

Description: 
return: a read\-only list of acquisition expressions

## Method: getTryBody
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`

Description: Get the try block.
return: the try block, never null

## Method: hasFinallyBlock
- return type: `boolean`

Description: 
return: 

## Method: isTryWithResource
- return type: `boolean`

Description: 
return: true if this try\-statement is a try\-with\-resource \(a try with resource\-acquisition expressions\)

## Method: removeCatchBlock
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaCatchBlock`

Description: 
parameter: index: 
return: 

## Method: removeResourceAcq
- parameter: `i`, type: `int`

Description: 
parameter: i: acquisition expression index

## Method: setFinallyBlock
- parameter: `blk`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`

Description: 
parameter: blk: 

## Method: setTryBody
- parameter: `b`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaBlock`

Description: Set the try block protected by catch clauses.
parameter: b: a non\-null block

