TryCatchStatement (Groovy 5.0.7)
Description: declaration: package: org.codehaus.groovy.ast.stmt, class: TryCatchStatement

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

All Implemented Interfaces:
  `NodeMetaDataHandler`

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

  Modifier and Type
  Method
  Description
  `TryCatchStatement`
  `addCatch(CatchStatement catchStatement)`
  `void`
  `addCatch$$bridge(CatchStatement catchStatement)`
  Deprecated.
  `TryCatchStatement`
  `addResource(ExpressionStatement resourceStatement)`
  `void`
  `addResource$$bridge(ExpressionStatement resourceStatement)`
  Deprecated.
  `CatchStatement`
  `getCatchStatement(int idx)`
  `List<CatchStatement>`
  `getCatchStatements()`
  `Statement`
  `getFinallyStatement()`
  `ExpressionStatement`
  `getResourceStatement(int idx)`
  `List<ExpressionStatement>`
  `getResourceStatements()`
  `Statement`
  `getTryStatement()`
  `static boolean`
  `isResource(Expression expression)`
  `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, copyStatementLabels, getStatementLabel, getStatementLabels, isEmpty, setStatementLabel`

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

  `copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition`

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

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

  ### Methods inherited from interface org.codehaus.groovy.ast.NodeMetaDataHandler

  `copyNodeMetaData, getNodeMetaData, getNodeMetaData, getNodeMetaData, newMetaDataMap, putNodeMetaData, removeNodeMetaData, setNodeMetaData`

- ## Constructor Details

  - ### TryCatchStatement

    public TryCatchStatement(Statement tryStatement, Statement finallyStatement)

- ## Method Details

  - ### visit

    public void visit(GroovyCodeVisitor visitor)
    Overrides:
      `visit` in class `ASTNode`

  - ### getTryStatement

    public Statement getTryStatement()

  - ### getFinallyStatement

    public Statement getFinallyStatement()

  - ### getCatchStatement

    public CatchStatement getCatchStatement(int idx)
    Returns:
      The catch statement of the given index or null.

  - ### getCatchStatements

    public List<CatchStatement> getCatchStatements()

  - ### getResourceStatement

    public ExpressionStatement getResourceStatement(int idx)
    Returns:
      The resource statement of the given index or null.

  - ### getResourceStatements

    public List<ExpressionStatement> getResourceStatements()

  - ### isResource

    public static boolean isResource(Expression expression)

  - ### setTryStatement

    public void setTryStatement(Statement tryStatement)

  - ### setFinallyStatement

    public void setFinallyStatement(Statement finallyStatement)

  - ### setCatchStatement

    public void setCatchStatement(int idx, CatchStatement catchStatement)

  - ### addCatch$$bridge

    @Deprecated public void addCatch$$bridge(CatchStatement catchStatement)
    Deprecated.

  - ### addCatch

    public TryCatchStatement addCatch(CatchStatement catchStatement)

  - ### addResource$$bridge

    @Deprecated public void addResource$$bridge(ExpressionStatement resourceStatement)
    Deprecated.

  - ### addResource

    public TryCatchStatement addResource(ExpressionStatement resourceStatement)