class ImplJTry extends BasicJBlock implements JTry
JBlock.Braces| Modifier and Type | Field and Description |
|---|---|
private java.util.ArrayList<ImplJCatch> |
catches |
private FinallyJBlock |
finallyBlock |
private java.util.ArrayList<FirstJVarDeclaration> |
resources |
| Constructor and Description |
|---|
ImplJTry(BasicJBlock parent) |
| Modifier and Type | Method and Description |
|---|---|
JCatch |
_catch(int mods,
java.lang.Class<? extends java.lang.Throwable> type,
java.lang.String var)
Add a
catch block. |
JCatch |
_catch(int mods,
JType type,
java.lang.String var)
Add a
catch block. |
JCatch |
_catch(int mods,
java.lang.String type,
java.lang.String var)
Add a
catch block. |
JBlock |
_finally()
Add the
finally block for this try. |
private <T extends FirstJVarDeclaration> |
add(T item) |
private <T extends ImplJCatch> |
add(T item) |
JTry |
ignore(java.lang.Class<? extends java.lang.Throwable> type)
Add a
catch for an ignored exception. |
JTry |
ignore(JType type)
Add a
catch for an ignored exception. |
JTry |
ignore(java.lang.String type)
Add a
catch 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 for
try-with-resources constructs. |
JVarDeclaration |
with(int mods,
JType type,
java.lang.String var,
JExpr init)
Add a resource for
try-with-resources constructs. |
JVarDeclaration |
with(int mods,
java.lang.String type,
java.lang.String var,
JExpr init)
Add a resource for
try-with-resources constructs. |
void |
write(SourceFileWriter writer) |
_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, get, getParent, hasSingleItemOfType, label, label, lshrAssign, modAssign, mulAssign, orAssign, postDec, postInc, preDec, preInc, shlAssign, shrAssign, size, subAssign, tempName, tempVar, tempVar, tempVar, var, var, var, var, var, var, write, write, xorAssignblockComment, lineComment, writeCommentsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait_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, lineCommentprivate java.util.ArrayList<ImplJCatch> catches
private java.util.ArrayList<FirstJVarDeclaration> resources
private FinallyJBlock finallyBlock
ImplJTry(BasicJBlock parent)
public JVarDeclaration with(int mods, java.lang.String type, java.lang.String var, JExpr init)
JTrytry-with-resources constructs.public JVarDeclaration with(int mods, JType type, java.lang.String var, JExpr init)
JTrytry-with-resources constructs.public JVarDeclaration with(int mods, java.lang.Class<? extends java.lang.AutoCloseable> type, java.lang.String var, JExpr init)
JTrytry-with-resources constructs.private <T extends FirstJVarDeclaration> T add(T item)
public JCatch _catch(int mods, java.lang.String type, java.lang.String var)
JTrycatch block.public JCatch _catch(int mods, java.lang.Class<? extends java.lang.Throwable> type, java.lang.String var)
JTrycatch block.public JCatch _catch(int mods, JType type, java.lang.String var)
JTrycatch block.private <T extends ImplJCatch> T add(T item)
public JTry ignore(java.lang.String type)
JTrycatch for an ignored exception.public JTry ignore(java.lang.Class<? extends java.lang.Throwable> type)
JTrycatch for an ignored exception.public JTry ignore(JType type)
JTrycatch for an ignored exception.public JBlock _finally()
JTryfinally block for this try.public void write(SourceFileWriter writer) throws java.io.IOException
write in interface Writablewrite in class BasicJBlockjava.io.IOException