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
Atryblock.
-
-
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 acatchblock.JCatch_catch(int mods, java.lang.String type, java.lang.String var)Add acatchblock.JCatch_catch(int mods, JType type, java.lang.String var)Add acatchblock.JBlock_finally()Add thefinallyblock for thistry.JTryignore(java.lang.Class<? extends java.lang.Throwable> type)Add acatchfor an ignored exception.JTryignore(java.lang.String type)Add acatchfor an ignored exception.JTryignore(JType type)Add acatchfor an ignored exception.JVarDeclarationwith(int mods, java.lang.Class<? extends java.lang.AutoCloseable> type, java.lang.String var, JExpr init)Add a resource fortry-with-resources constructs.JVarDeclarationwith(int mods, java.lang.String type, java.lang.String var, JExpr init)Add a resource fortry-with-resources constructs.JVarDeclarationwith(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 acatchblock.- Parameters:
mods- the catch block modifierstype- the exception typevar- the exception variable name- Returns:
- the
catchsub-block
-
_catch
JCatch _catch(int mods, java.lang.Class<? extends java.lang.Throwable> type, java.lang.String var)
Add acatchblock.- Parameters:
mods- the catch block modifierstype- the exception typevar- the exception variable name- Returns:
- the
catchsub-block
-
_catch
JCatch _catch(int mods, JType type, java.lang.String var)
Add acatchblock.- Parameters:
mods- the catch block modifierstype- the exception typevar- the exception variable name- Returns:
- the
catchsub-block
-
ignore
JTry ignore(java.lang.String type)
Add acatchfor an ignored exception.- Parameters:
type- the exception type- Returns:
- this
tryblock
-
ignore
JTry ignore(java.lang.Class<? extends java.lang.Throwable> type)
Add acatchfor an ignored exception.- Parameters:
type- the exception type- Returns:
- this
tryblock
-
ignore
JTry ignore(JType type)
Add acatchfor an ignored exception.- Parameters:
type- the exception type- Returns:
- this
tryblock
-
_finally
JBlock _finally()
Add thefinallyblock for thistry.- Returns:
- the
finallysub-block
-
-