Package deltix.util.jcg
Interface JTryStatement
-
- All Superinterfaces:
JStatement
- All Known Implementing Classes:
JTryStatementImpl
public interface JTryStatement extends JStatement
Supports all possible variations of try-catch-finally statement.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JCompoundStatement
addCatch(java.lang.Class<? extends java.lang.Throwable> t, java.lang.String varName)
Adds a catch clause for the specified Throwable.JCompoundStatement
addFinally()
Adds a finally clause.JLocalVariable
catchVariable(java.lang.Class<? extends java.lang.Throwable> t)
Returns a throwable variable of the specificed catch clauseJCompoundStatement
tryStmt()
Returns a compound statement of try{} clause.
-
-
-
Method Detail
-
tryStmt
JCompoundStatement tryStmt()
Returns a compound statement of try{} clause.
-
addCatch
JCompoundStatement addCatch(java.lang.Class<? extends java.lang.Throwable> t, java.lang.String varName)
Adds a catch clause for the specified Throwable.Adding the same Throwable twice causes an exception.
- Parameters:
t
- Throwable classvarName
- name of Throwable variable to declare
-
catchVariable
JLocalVariable catchVariable(java.lang.Class<? extends java.lang.Throwable> t)
Returns a throwable variable of the specificed catch clauseThrows an exception if addCatch was not called for the specified
t
.- Parameters:
t
- Throwable class
-
addFinally
JCompoundStatement addFinally()
Adds a finally clause.Calling of the method twice causes an exception.
-
-