Package deltix.util.jcg.scg
Class JTryStatementImpl
- java.lang.Object
-
- deltix.util.jcg.scg.JTryStatementImpl
-
- All Implemented Interfaces:
JStatement
,JTryStatement
,JCompStmtElem
public class JTryStatementImpl extends java.lang.Object implements JTryStatement
-
-
Constructor Summary
Constructors Constructor Description JTryStatementImpl(JContextImpl context)
-
Method Summary
All Methods Instance Methods Concrete 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 clausevoid
printElement(SourceCodePrinter out)
JCompoundStatement
tryStmt()
Returns a compound statement of try{} clause.
-
-
-
Constructor Detail
-
JTryStatementImpl
public JTryStatementImpl(JContextImpl context)
-
-
Method Detail
-
printElement
public void printElement(SourceCodePrinter out) throws java.io.IOException
- Specified by:
printElement
in interfaceJCompStmtElem
- Throws:
java.io.IOException
-
tryStmt
public JCompoundStatement tryStmt()
Description copied from interface:JTryStatement
Returns a compound statement of try{} clause.- Specified by:
tryStmt
in interfaceJTryStatement
-
addCatch
public JCompoundStatement addCatch(java.lang.Class<? extends java.lang.Throwable> t, java.lang.String varName)
Description copied from interface:JTryStatement
Adds a catch clause for the specified Throwable.Adding the same Throwable twice causes an exception.
- Specified by:
addCatch
in interfaceJTryStatement
- Parameters:
t
- Throwable classvarName
- name of Throwable variable to declare
-
catchVariable
public JLocalVariable catchVariable(java.lang.Class<? extends java.lang.Throwable> t)
Description copied from interface:JTryStatement
Returns a throwable variable of the specificed catch clauseThrows an exception if addCatch was not called for the specified
t
.- Specified by:
catchVariable
in interfaceJTryStatement
- Parameters:
t
- Throwable class
-
addFinally
public JCompoundStatement addFinally()
Description copied from interface:JTryStatement
Adds a finally clause.Calling of the method twice causes an exception.
- Specified by:
addFinally
in interfaceJTryStatement
-
-