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 void
addCatch(CatchStatement catchStatement)
void
addResource(ExpressionStatement resourceStatement)
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, putNodeMetaData, removeNodeMetaData, setNodeMetaData
-
Constructor Details
-
TryCatchStatement
-
-
Method Details
-
visit
-
getResourceStatements
-
getCatchStatements
-
getFinallyStatement
-
getTryStatement
-
addResource
-
isResource
-
addCatch
-
getCatchStatement
- Returns:
- the catch statement of the given index or null
-
getResourceStatement
- Returns:
- the resource statement of the given index or null
-
setTryStatement
-
setCatchStatement
-
setFinallyStatement
-