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 JCompoundStatementaddCatch(java.lang.Class<? extends java.lang.Throwable> t, java.lang.String varName)Adds a catch clause for the specified Throwable.JCompoundStatementaddFinally()Adds a finally clause.JLocalVariablecatchVariable(java.lang.Class<? extends java.lang.Throwable> t)Returns a throwable variable of the specificed catch clausevoidprintElement(SourceCodePrinter out)JCompoundStatementtryStmt()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:
printElementin interfaceJCompStmtElem- Throws:
java.io.IOException
-
tryStmt
public JCompoundStatement tryStmt()
Description copied from interface:JTryStatementReturns a compound statement of try{} clause.- Specified by:
tryStmtin interfaceJTryStatement
-
addCatch
public JCompoundStatement addCatch(java.lang.Class<? extends java.lang.Throwable> t, java.lang.String varName)
Description copied from interface:JTryStatementAdds a catch clause for the specified Throwable.Adding the same Throwable twice causes an exception.
- Specified by:
addCatchin 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:JTryStatementReturns a throwable variable of the specificed catch clauseThrows an exception if addCatch was not called for the specified
t.- Specified by:
catchVariablein interfaceJTryStatement- Parameters:
t- Throwable class
-
addFinally
public JCompoundStatement addFinally()
Description copied from interface:JTryStatementAdds a finally clause.Calling of the method twice causes an exception.
- Specified by:
addFinallyin interfaceJTryStatement
-
-