Package org.jboss.jdeparser
Class ImplJTry
- java.lang.Object
-
- org.jboss.jdeparser.BasicJCommentable
-
- org.jboss.jdeparser.BasicJBlock
-
- org.jboss.jdeparser.ImplJTry
-
- All Implemented Interfaces:
BlockContent
,JBlock
,JCommentable
,JStatement
,JTry
,Writable
class ImplJTry extends BasicJBlock implements JTry
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.jdeparser.JBlock
JBlock.Braces
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList<ImplJCatch>
catches
private FinallyJBlock
finallyBlock
private java.util.ArrayList<FirstJVarDeclaration>
resources
-
Constructor Summary
Constructors Constructor Description ImplJTry(BasicJBlock parent)
-
Method Summary
All Methods Instance Methods Concrete 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
.private <T extends FirstJVarDeclaration>
Tadd(T item)
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.void
write(SourceFileWriter writer)
-
Methods inherited from class org.jboss.jdeparser.BasicJBlock
_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, xorAssign
-
Methods inherited from class org.jboss.jdeparser.BasicJCommentable
blockComment, lineComment, writeComments
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
-
-
-
-
Field Detail
-
catches
private java.util.ArrayList<ImplJCatch> catches
-
resources
private java.util.ArrayList<FirstJVarDeclaration> resources
-
finallyBlock
private FinallyJBlock finallyBlock
-
-
Constructor Detail
-
ImplJTry
ImplJTry(BasicJBlock parent)
-
-
Method Detail
-
with
public JVarDeclaration with(int mods, java.lang.String type, java.lang.String var, JExpr init)
Description copied from interface:JTry
Add a resource fortry
-with-resources constructs.
-
with
public JVarDeclaration with(int mods, JType type, java.lang.String var, JExpr init)
Description copied from interface:JTry
Add a resource fortry
-with-resources constructs.
-
with
public JVarDeclaration with(int mods, java.lang.Class<? extends java.lang.AutoCloseable> type, java.lang.String var, JExpr init)
Description copied from interface:JTry
Add a resource fortry
-with-resources constructs.
-
add
private <T extends FirstJVarDeclaration> T add(T item)
-
_catch
public JCatch _catch(int mods, java.lang.String type, java.lang.String var)
Description copied from interface:JTry
Add acatch
block.
-
_catch
public JCatch _catch(int mods, java.lang.Class<? extends java.lang.Throwable> type, java.lang.String var)
Description copied from interface:JTry
Add acatch
block.
-
_catch
public JCatch _catch(int mods, JType type, java.lang.String var)
Description copied from interface:JTry
Add acatch
block.
-
add
private <T extends ImplJCatch> T add(T item)
-
ignore
public JTry ignore(java.lang.String type)
Description copied from interface:JTry
Add acatch
for an ignored exception.
-
ignore
public JTry ignore(java.lang.Class<? extends java.lang.Throwable> type)
Description copied from interface:JTry
Add acatch
for an ignored exception.
-
ignore
public JTry ignore(JType type)
Description copied from interface:JTry
Add acatch
for an ignored exception.
-
_finally
public JBlock _finally()
Description copied from interface:JTry
Add thefinally
block for thistry
.
-
write
public void write(SourceFileWriter writer) throws java.io.IOException
- Specified by:
write
in interfaceWritable
- Overrides:
write
in classBasicJBlock
- Throws:
java.io.IOException
-
-