01: /* Generated By:JJTree: Do not edit this line. ASTTryStatement.java */
02:
03: package net.sourceforge.pmd.ast;
04:
05: public class ASTTryStatement extends SimpleJavaNode {
06:
07: public ASTTryStatement(int id) {
08: super (id);
09: }
10:
11: public ASTTryStatement(JavaParser p, int id) {
12: super (p, id);
13: }
14:
15: /**
16: * Accept the visitor. *
17: */
18: public Object jjtAccept(JavaParserVisitor visitor, Object data) {
19: return visitor.visit(this , data);
20: }
21:
22: public boolean hasFinally() {
23: for (int i = 0; i < this .jjtGetNumChildren(); i++) {
24: if (jjtGetChild(i) instanceof ASTFinallyStatement) {
25: return true;
26: }
27: }
28: return false;
29: }
30:
31: public ASTFinallyStatement getFinally() {
32: for (int i = 0; i < this .jjtGetNumChildren(); i++) {
33: if (jjtGetChild(i) instanceof ASTFinallyStatement) {
34: return (ASTFinallyStatement) jjtGetChild(i);
35: }
36: }
37: throw new RuntimeException(
38: "ASTTryStatement.getFinally called but this try stmt doesn't contain a finally block");
39: }
40:
41: }
|