Package org.codehaus.janino
Class Java.TryStatement
java.lang.Object
org.codehaus.janino.Java.Located
org.codehaus.janino.Java.Statement
org.codehaus.janino.Java.TryStatement
- All Implemented Interfaces:
Java.BlockStatement
,Java.Locatable
,Java.Scope
- Enclosing class:
Java
Representation of a JLS7 14.20 TRY statement.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Representation of a JLS9 14.20.2 "local-variable-declarator resource" in a TRY-with-resources statement.static class
Representation of a JLS9 14.20.2 "resource" in a TRY-with-resources statement.static class
Representation of a JLS9 14.20.2 "variable-access resource" in a TRY-with-resources statement. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Java.BlockStatement
The body of the TRY statement.final List
<Java.CatchClause> The list of catch clauses (including the "default" clause) of the TRY statement.final Java.Block
The optional "finally" block of the TRY statement.final List
<Java.TryStatement.Resource> The "resources" managed by the TRY-with-resources statement.Fields inherited from class org.codehaus.janino.Java.Statement
localVariables
Fields inherited from class org.codehaus.janino.Java.Located
NOWHERE
-
Constructor Summary
ConstructorsConstructorDescriptionTryStatement
(Location location, List<Java.TryStatement.Resource> resources, Java.BlockStatement body, List<Java.CatchClause> catchClauses) A TRY statement without a FINALLY clause.TryStatement
(Location location, List<Java.TryStatement.Resource> resources, Java.BlockStatement body, List<Java.CatchClause> catchClauses, Java.Block finallY) TryStatement
(Location location, Java.BlockStatement body, List<Java.CatchClause> catchClauses) A TRY statement with no resources and no FINALLY clause. -
Method Summary
Modifier and TypeMethodDescription<R,
EX extends Throwable>
Raccept
(Visitor.BlockStatementVisitor<R, EX> visitor) Invokes the "visit...()
" method ofVisitor.BlockStatementVisitor
for the concreteJava.BlockStatement
type.toString()
Methods inherited from class org.codehaus.janino.Java.Statement
findLocalVariable, getEnclosingScope, setEnclosingScope
Methods inherited from class org.codehaus.janino.Java.Located
getLocation, throwCompileException
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.codehaus.janino.Java.Locatable
getLocation, throwCompileException
-
Field Details
-
resources
The "resources" managed by the TRY-with-resources statement. -
body
The body of the TRY statement. -
catchClauses
The list of catch clauses (including the "default" clause) of the TRY statement. -
finallY
The optional "finally" block of the TRY statement.
-
-
Constructor Details
-
TryStatement
public TryStatement(Location location, Java.BlockStatement body, List<Java.CatchClause> catchClauses) A TRY statement with no resources and no FINALLY clause. -
TryStatement
public TryStatement(Location location, List<Java.TryStatement.Resource> resources, Java.BlockStatement body, List<Java.CatchClause> catchClauses) A TRY statement without a FINALLY clause. -
TryStatement
public TryStatement(Location location, List<Java.TryStatement.Resource> resources, Java.BlockStatement body, List<Java.CatchClause> catchClauses, @Nullable Java.Block finallY)
-
-
Method Details
-
toString
-
accept
@Nullable public <R,EX extends Throwable> R accept(Visitor.BlockStatementVisitor<R, EX> visitor) throws EXDescription copied from interface:Java.BlockStatement
Invokes the "visit...()
" method ofVisitor.BlockStatementVisitor
for the concreteJava.BlockStatement
type.- Throws:
EX
-