Package org.codehaus.groovy.ast.stmt

## Class TryCatchStatement

- java.lang.Object
- - org.codehaus.groovy.ast.ASTNode
  - - org.codehaus.groovy.ast.stmt.Statement
    - - org.codehaus.groovy.ast.stmt.TryCatchStatement

-     public class TryCatchStatement
      extends Statement

  Represents a try { ... } catch () finally {} statement in Groovy

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TryCatchStatement​(Statement tryStatement, Statement finallyStatement)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addCatch​(CatchStatement catchStatement)` |
    `CatchStatement` | `getCatchStatement​(int idx)` |
    `List<CatchStatement>` | `getCatchStatements()` |
    `Statement` | `getFinallyStatement()` |
    `Statement` | `getTryStatement()` |
    `void` | `setCatchStatement​(int idx, CatchStatement catchStatement)` |
    `void` | `setFinallyStatement​(Statement finallyStatement)` |
    `void` | `setTryStatement​(Statement tryStatement)` |
    `void` | `visit​(GroovyCodeVisitor visitor)` |

    - ### Methods inherited from class org.codehaus.groovy.ast.stmt.Statement

      `addStatementLabel, getStatementLabel, getStatementLabels, isEmpty, setStatementLabel`

    - ### Methods inherited from class org.codehaus.groovy.ast.ASTNode

      `copyNodeMetaData, equals, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getNodeMetaData, getNodeMetaData, getText, hashCode, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TryCatchStatement

          public TryCatchStatement​(Statement tryStatement,
                                   Statement finallyStatement)

  - ### Method Detail

    - #### visit

          public void visit​(GroovyCodeVisitor visitor)

      Overrides:
        `visit` in class `ASTNode`

    - #### getCatchStatements

          public List<CatchStatement> getCatchStatements()

    - #### getFinallyStatement

          public Statement getFinallyStatement()

    - #### getTryStatement

          public Statement getTryStatement()

    - #### addCatch

          public void addCatch​(CatchStatement catchStatement)

    - #### getCatchStatement

          public CatchStatement getCatchStatement​(int idx)

      Returns:
        the catch statement of the given index or null

    - #### setTryStatement

          public void setTryStatement​(Statement tryStatement)

    - #### setCatchStatement

          public void setCatchStatement​(int idx,
                                        CatchStatement catchStatement)

    - #### setFinallyStatement

          public void setFinallyStatement​(Statement finallyStatement)