Package org.sonar.plugins.java.api.tree
Interface TryStatementTree
-
- All Superinterfaces:
StatementTree
,Tree
- All Known Implementing Classes:
TryStatementTreeImpl
@Beta public interface TryStatementTree extends StatementTree
'try' statement. JLS 14.20try
block()
catches()
finallyfinallyBlock()
try (resourceList()
)block()
catches()
finallyfinallyBlock()
- Since:
- Java 1.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description BlockTree
block()
List<CatchTree>
catches()
SyntaxToken
closeParenToken()
BlockTree
finallyBlock()
SyntaxToken
finallyKeyword()
SyntaxToken
openParenToken()
ListTree<Tree>
resourceList()
Until Java 9, resource could only be instance ofVariableTree
.ListTree<VariableTree>
resources()
Deprecated.since 4.11.SyntaxToken
tryKeyword()
-
-
-
Method Detail
-
tryKeyword
SyntaxToken tryKeyword()
-
openParenToken
@Nullable SyntaxToken openParenToken()
-
resources
@Deprecated ListTree<VariableTree> resources()
Deprecated.since 4.11. UseresourceList()
to get all declared resources.Java 9 allows resources to be declared by existing effectively final variables. This method will not return trees of resources declared by such variables, only resources declared with new variables will be returned (as it was until Java 9).- Since:
- Java 1.7
-
resourceList
ListTree<Tree> resourceList()
Until Java 9, resource could only be instance ofVariableTree
. Since Java 9 it is possible to refer to resources by existing effectively final variables, so list can also containIdentifierTree
orMemberSelectExpressionTree
.- Since:
- Java 9
-
closeParenToken
@Nullable SyntaxToken closeParenToken()
-
block
BlockTree block()
-
finallyKeyword
@Nullable SyntaxToken finallyKeyword()
-
-