Class TryCatchStatement

All Implemented Interfaces:
NodeMetaDataHandler

public class TryCatchStatement
extends Statement
Represents a try { ... } catch () finally {} statement in Groovy
  • Constructor Details

    • TryCatchStatement

      public TryCatchStatement​(Statement tryStatement, Statement finallyStatement)
  • Method Details

    • visit

      public void visit​(GroovyCodeVisitor visitor)
      Overrides:
      visit in class ASTNode
    • getResourceStatements

      public List<ExpressionStatement> getResourceStatements()
    • getCatchStatements

      public List<CatchStatement> getCatchStatements()
    • getFinallyStatement

      public Statement getFinallyStatement()
    • getTryStatement

      public Statement getTryStatement()
    • addResource

      public void addResource​(ExpressionStatement resourceStatement)
    • isResource

      public static boolean isResource​(Expression expression)
    • addCatch

      public void addCatch​(CatchStatement catchStatement)
    • getCatchStatement

      public CatchStatement getCatchStatement​(int idx)
      Returns:
      the catch statement of the given index or null
    • getResourceStatement

      public ExpressionStatement getResourceStatement​(int idx)
      Returns:
      the resource 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)