Package org.jboss.jdeparser
Interface JTry
- All Superinterfaces:
JBlock,JCommentable,JStatement
- All Known Subinterfaces:
JCatch
- All Known Implementing Classes:
ImplJCatch,ImplJTry
A
try block.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jboss.jdeparser.JBlock
JBlock.Braces -
Method Summary
Modifier and TypeMethodDescriptionAdd acatchblock.Add acatchblock.Add acatchblock._finally()Add thefinallyblock for thistry.Add acatchfor an ignored exception.Add acatchfor an ignored exception.Add acatchfor an ignored exception.with(int mods, Class<? extends AutoCloseable> type, String var, JExpr init) Add a resource fortry-with-resources constructs.Add a resource fortry-with-resources constructs.Add a resource fortry-with-resources constructs.Methods inherited from interface org.jboss.jdeparser.JBlock
_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, xorAssignMethods inherited from interface org.jboss.jdeparser.JCommentable
blockComment, lineComment
-
Method Details
-
with
Add a resource fortry-with-resources constructs.- Parameters:
mods- the resource variable modifierstype- the resource variable typevar- the resource variable nameinit- the resource variable initialization value- Returns:
- the variable declaration
-
with
Add a resource fortry-with-resources constructs.- Parameters:
mods- the resource variable modifierstype- the resource variable typevar- the resource variable nameinit- the resource variable initialization value- Returns:
- the variable declaration
-
with
Add a resource fortry-with-resources constructs.- Parameters:
mods- the resource variable modifierstype- the resource variable typevar- the resource variable nameinit- the resource variable initialization value- Returns:
- the variable declaration
-
_catch
Add acatchblock.- Parameters:
mods- the catch block modifierstype- the exception typevar- the exception variable name- Returns:
- the
catchsub-block
-
_catch
Add acatchblock.- Parameters:
mods- the catch block modifierstype- the exception typevar- the exception variable name- Returns:
- the
catchsub-block
-
_catch
Add acatchblock.- Parameters:
mods- the catch block modifierstype- the exception typevar- the exception variable name- Returns:
- the
catchsub-block
-
ignore
Add acatchfor an ignored exception.- Parameters:
type- the exception type- Returns:
- this
tryblock
-
ignore
Add acatchfor an ignored exception.- Parameters:
type- the exception type- Returns:
- this
tryblock
-
ignore
Add acatchfor an ignored exception.- Parameters:
type- the exception type- Returns:
- this
tryblock
-
_finally
JBlock _finally()Add thefinallyblock for thistry.- Returns:
- the
finallysub-block
-