Package org.jboss.jdeparser
Interface JTry
-
- All Superinterfaces:
JBlock
,JCommentable
,JStatement
- All Known Subinterfaces:
JCatch
- All Known Implementing Classes:
ImplJCatch
,ImplJTry
public interface JTry extends JBlock
Atry
block.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.jdeparser.JBlock
JBlock.Braces
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JCatch
_catch(int mods, java.lang.Class<? extends java.lang.Throwable> type, java.lang.String var)
Add acatch
block.JCatch
_catch(int mods, java.lang.String type, java.lang.String var)
Add acatch
block.JCatch
_catch(int mods, JType type, java.lang.String var)
Add acatch
block.JBlock
_finally()
Add thefinally
block for thistry
.JTry
ignore(java.lang.Class<? extends java.lang.Throwable> type)
Add acatch
for an ignored exception.JTry
ignore(java.lang.String type)
Add acatch
for an ignored exception.JTry
ignore(JType type)
Add acatch
for an ignored exception.JVarDeclaration
with(int mods, java.lang.Class<? extends java.lang.AutoCloseable> type, java.lang.String var, JExpr init)
Add a resource fortry
-with-resources constructs.JVarDeclaration
with(int mods, java.lang.String type, java.lang.String var, JExpr init)
Add a resource fortry
-with-resources constructs.JVarDeclaration
with(int mods, JType type, java.lang.String var, JExpr init)
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 Detail
-
with
JVarDeclaration with(int mods, java.lang.String type, java.lang.String var, JExpr init)
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
JVarDeclaration with(int mods, JType type, java.lang.String var, JExpr init)
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
JVarDeclaration with(int mods, java.lang.Class<? extends java.lang.AutoCloseable> type, java.lang.String var, JExpr init)
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
JCatch _catch(int mods, java.lang.String type, java.lang.String var)
Add acatch
block.- Parameters:
mods
- the catch block modifierstype
- the exception typevar
- the exception variable name- Returns:
- the
catch
sub-block
-
_catch
JCatch _catch(int mods, java.lang.Class<? extends java.lang.Throwable> type, java.lang.String var)
Add acatch
block.- Parameters:
mods
- the catch block modifierstype
- the exception typevar
- the exception variable name- Returns:
- the
catch
sub-block
-
_catch
JCatch _catch(int mods, JType type, java.lang.String var)
Add acatch
block.- Parameters:
mods
- the catch block modifierstype
- the exception typevar
- the exception variable name- Returns:
- the
catch
sub-block
-
ignore
JTry ignore(java.lang.String type)
Add acatch
for an ignored exception.- Parameters:
type
- the exception type- Returns:
- this
try
block
-
ignore
JTry ignore(java.lang.Class<? extends java.lang.Throwable> type)
Add acatch
for an ignored exception.- Parameters:
type
- the exception type- Returns:
- this
try
block
-
ignore
JTry ignore(JType type)
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
-
-