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
 
public static final class Java.TryStatement extends Java.Statement
Representation of a JLS7 14.20 TRY statement. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJava.TryStatement.LocalVariableDeclaratorResourceRepresentation of a JLS9 14.20.2 "local-variable-declarator resource" in a TRY-with-resources statement.static classJava.TryStatement.ResourceRepresentation of a JLS9 14.20.2 "resource" in a TRY-with-resources statement.static classJava.TryStatement.VariableAccessResourceRepresentation of a JLS9 14.20.2 "variable-access resource" in a TRY-with-resources statement. 
- 
Field Summary
Fields Modifier and Type Field Description Java.BlockStatementbodyThe body of the TRY statement.java.util.List<Java.CatchClause>catchClausesThe list of catch clauses (including the "default" clause) of the TRY statement.Java.BlockfinallYThe optional "finally" block of the TRY statement.java.util.List<Java.TryStatement.Resource>resourcesThe "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
Constructors Constructor Description TryStatement(Location location, java.util.List<Java.TryStatement.Resource> resources, Java.BlockStatement body, java.util.List<Java.CatchClause> catchClauses)A TRY statement without a FINALLY clause.TryStatement(Location location, java.util.List<Java.TryStatement.Resource> resources, Java.BlockStatement body, java.util.List<Java.CatchClause> catchClauses, Java.Block finallY)TryStatement(Location location, Java.BlockStatement body, java.util.List<Java.CatchClause> catchClauses)A TRY statement with no resources and no FINALLY clause. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,EX extends java.lang.Throwable>
Raccept(Visitor.BlockStatementVisitor<R,EX> visitor)Invokes the "visit...()" method ofVisitor.BlockStatementVisitorfor the concreteJava.BlockStatementtype.java.lang.StringtoString()- 
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 Detail
- 
resources
public final java.util.List<Java.TryStatement.Resource> resources
The "resources" managed by the TRY-with-resources statement. 
- 
body
public final Java.BlockStatement body
The body of the TRY statement. 
- 
catchClauses
public final java.util.List<Java.CatchClause> catchClauses
The list of catch clauses (including the "default" clause) of the TRY statement. 
- 
finallY
@Nullable public final Java.Block finallY
The optional "finally" block of the TRY statement. 
 - 
 
- 
Constructor Detail
- 
TryStatement
public TryStatement(Location location, Java.BlockStatement body, java.util.List<Java.CatchClause> catchClauses)
A TRY statement with no resources and no FINALLY clause. 
- 
TryStatement
public TryStatement(Location location, java.util.List<Java.TryStatement.Resource> resources, Java.BlockStatement body, java.util.List<Java.CatchClause> catchClauses)
A TRY statement without a FINALLY clause. 
- 
TryStatement
public TryStatement(Location location, java.util.List<Java.TryStatement.Resource> resources, Java.BlockStatement body, java.util.List<Java.CatchClause> catchClauses, @Nullable Java.Block finallY)
 
 - 
 
- 
Method Detail
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
- 
accept
@Nullable public <R,EX extends java.lang.Throwable> R accept(Visitor.BlockStatementVisitor<R,EX> visitor) throws EX extends java.lang.Throwable
Description copied from interface:Java.BlockStatementInvokes the "visit...()" method ofVisitor.BlockStatementVisitorfor the concreteJava.BlockStatementtype.- Throws:
 EX extends java.lang.Throwable
 
 - 
 
 -