net.sourceforge.pmd.lang.ast.Node, JavaNode, net.sourceforge.pmd.lang.symboltable.ScopedNodepublic class ASTTryStatement extends AbstractJavaNode
TryStatement ::= "try" ( ResourceSpecification )? Block ( CatchStatement )* [ FinallyStatement ]
parser| Constructor | Description |
|---|---|
ASTTryStatement(int id) |
|
ASTTryStatement(JavaParser p,
int id) |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.List<ASTCatchStatement> |
getCatchStatements() |
Returns the catch statement nodes of this try statement.
|
ASTFinallyStatement |
getFinally() |
Returns the
finally statement of this try statement, if any. |
boolean |
hasFinally() |
Returns true if this try statement has a
finally statement,
in which case getFinally() won't return null. |
boolean |
isTryWithResources() |
Returns true if this node is a try-with-resources, in which case it
has a ResourceSpecification child node.
|
java.lang.Object |
jjtAccept(JavaParserVisitor visitor,
java.lang.Object data) |
Accept the visitor.
|
childrenAccept, comment, comment, getScope, getXPathNodeName, jjtClose, jjtOpen, setScopeappendElement, findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfAnyType, getFirstParentOfType, getImage, getNthParent, getParentsOfType, getUserData, hasDecendantOfAnyType, hasDescendantMatchingXPath, hasDescendantOfAnyType, hasDescendantOfType, hasImageEqualTo, isFindBoundary, isSingleLine, jjtAddChild, jjtGetChild, jjtGetChildIndex, jjtGetFirstToken, jjtGetId, jjtGetLastToken, jjtGetNumChildren, jjtGetParent, jjtSetChildIndex, jjtSetFirstToken, jjtSetLastToken, jjtSetParent, remove, removeChildAtIndex, setDataFlowNode, setImage, setUserData, testingOnlySetBeginColumn, testingOnlySetBeginLine, testingOnlySetEndColumn, testingOnlySetEndLine, toStringfindChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfAnyType, getFirstParentOfType, getImage, getNthParent, getParentsOfType, getUserData, hasDescendantMatchingXPath, hasDescendantOfType, hasImageEqualTo, isFindBoundary, jjtAddChild, jjtGetChild, jjtGetChildIndex, jjtGetId, jjtGetNumChildren, jjtGetParent, jjtSetChildIndex, jjtSetParent, remove, removeChildAtIndex, setDataFlowNode, setImage, setUserDatapublic ASTTryStatement(int id)
public ASTTryStatement(JavaParser p, int id)
public java.lang.Object jjtAccept(JavaParserVisitor visitor, java.lang.Object data)
AbstractJavaNodejjtAccept in interface JavaNodejjtAccept in class AbstractJavaNodepublic boolean isTryWithResources()
public java.util.List<ASTCatchStatement> getCatchStatements()
public boolean hasFinally()
finally statement,
in which case getFinally() won't return null.public ASTFinallyStatement getFinally()
finally statement of this try statement, if any.Copyright © 2002–2018 PMD. All rights reserved.