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>catchesprivate FinallyJBlockfinallyBlockprivate 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 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.private <T extends FirstJVarDeclaration>
Tadd(T item)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.voidwrite(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:JTryAdd a resource fortry-with-resources constructs.
-
with
public JVarDeclaration with(int mods, JType type, java.lang.String var, JExpr init)
Description copied from interface:JTryAdd 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:JTryAdd 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:JTryAdd acatchblock.
-
_catch
public JCatch _catch(int mods, java.lang.Class<? extends java.lang.Throwable> type, java.lang.String var)
Description copied from interface:JTryAdd acatchblock.
-
_catch
public JCatch _catch(int mods, JType type, java.lang.String var)
Description copied from interface:JTryAdd acatchblock.
-
add
private <T extends ImplJCatch> T add(T item)
-
ignore
public JTry ignore(java.lang.String type)
Description copied from interface:JTryAdd acatchfor an ignored exception.
-
ignore
public JTry ignore(java.lang.Class<? extends java.lang.Throwable> type)
Description copied from interface:JTryAdd acatchfor an ignored exception.
-
ignore
public JTry ignore(JType type)
Description copied from interface:JTryAdd acatchfor an ignored exception.
-
_finally
public JBlock _finally()
Description copied from interface:JTryAdd thefinallyblock for thistry.
-
write
public void write(SourceFileWriter writer) throws java.io.IOException
- Specified by:
writein interfaceWritable- Overrides:
writein classBasicJBlock- Throws:
java.io.IOException
-
-