
public interface JTry extends JBlock
try block.JBlock.Braces| Modifier and Type | Method and Description |
|---|---|
JCatch |
_catch(int mods,
Class<? extends Throwable> type,
String var)
Add a
catch block. |
JCatch |
_catch(int mods,
JType type,
String var)
Add a
catch block. |
JCatch |
_catch(int mods,
String type,
String var)
Add a
catch block. |
JBlock |
_finally()
Add the
finally block for this try. |
JTry |
ignore(Class<? extends Throwable> type)
Add a
catch for an ignored exception. |
JTry |
ignore(JType type)
Add a
catch for an ignored exception. |
JTry |
ignore(String type)
Add a
catch for an ignored exception. |
JVarDeclaration |
with(int mods,
Class<? extends AutoCloseable> type,
String var,
JExpr init)
Add a resource for
try-with-resources constructs. |
JVarDeclaration |
with(int mods,
JType type,
String var,
JExpr init)
Add a resource for
try-with-resources constructs. |
JVarDeclaration |
with(int mods,
String type,
String var,
JExpr init)
Add a resource for
try-with-resources constructs. |
_assert, _assert, _break, _break, _class, _continue, _continue, _do, _for, _if, _new, _new, _new, _newAnon, _newAnon, _newAnon, _return, _return, _switch, _synchronized, _throw, _try, _while, add, addAssign, andAssign, anonLabel, anonLabel, assign, blankLine, block, call, call, call, call, callStatic, callStatic, callStatic, callStatic, callSuper, callThis, divAssign, empty, forEach, forEach, forEach, forwardLabel, label, label, lshrAssign, modAssign, mulAssign, orAssign, postDec, postInc, preDec, preInc, shlAssign, shrAssign, subAssign, tempName, tempVar, tempVar, tempVar, var, var, var, var, var, var, xorAssignblockComment, lineCommentJVarDeclaration with(int mods, String type, String var, JExpr init)
try-with-resources constructs.mods - the resource variable modifierstype - the resource variable typevar - the resource variable nameinit - the resource variable initialization valueJVarDeclaration with(int mods, JType type, String var, JExpr init)
try-with-resources constructs.mods - the resource variable modifierstype - the resource variable typevar - the resource variable nameinit - the resource variable initialization valueJVarDeclaration with(int mods, Class<? extends AutoCloseable> type, String var, JExpr init)
try-with-resources constructs.mods - the resource variable modifierstype - the resource variable typevar - the resource variable nameinit - the resource variable initialization valueJCatch _catch(int mods, String type, String var)
catch block.mods - the catch block modifierstype - the exception typevar - the exception variable namecatch sub-blockJCatch _catch(int mods, Class<? extends Throwable> type, String var)
catch block.mods - the catch block modifierstype - the exception typevar - the exception variable namecatch sub-blockJCatch _catch(int mods, JType type, String var)
catch block.mods - the catch block modifierstype - the exception typevar - the exception variable namecatch sub-blockJTry ignore(String type)
catch for an ignored exception.type - the exception typetry blockJTry ignore(Class<? extends Throwable> type)
catch for an ignored exception.type - the exception typetry blockJTry ignore(JType type)
catch for an ignored exception.type - the exception typetry blockJBlock _finally()
finally block for this try.finally sub-blockCopyright © 2025 JBoss by Red Hat. All rights reserved.