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 acatch
block.Add acatch
block.Add acatch
block._finally()
Add thefinally
block for thistry
.Add acatch
for an ignored exception.Add acatch
for an ignored exception.Add acatch
for 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, xorAssign
Methods 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 acatch
block.- Parameters:
mods
- the catch block modifierstype
- the exception typevar
- the exception variable name- Returns:
- the
catch
sub-block
-
_catch
Add acatch
block.- Parameters:
mods
- the catch block modifierstype
- the exception typevar
- the exception variable name- Returns:
- the
catch
sub-block
-
_catch
Add acatch
block.- Parameters:
mods
- the catch block modifierstype
- the exception typevar
- the exception variable name- Returns:
- the
catch
sub-block
-
ignore
Add acatch
for an ignored exception.- Parameters:
type
- the exception type- Returns:
- this
try
block
-
ignore
Add acatch
for an ignored exception.- Parameters:
type
- the exception type- Returns:
- this
try
block
-
ignore
Add acatch
for an ignored exception.- Parameters:
type
- the exception type- Returns:
- this
try
block
-
_finally
JBlock _finally()Add thefinally
block for thistry
.- Returns:
- the
finally
sub-block
-