ASTThrowStatement xref
1 /* Generated By:JJTree: Do not edit this line. ASTThrowStatement.java */
2
3 package net.sourceforge.pmd.ast;
4
5 public class ASTThrowStatement extends SimpleJavaNode {
6 public ASTThrowStatement(int id) {
7 super(id);
8 }
9
10 public ASTThrowStatement(JavaParser p, int id) {
11 super(p, id);
12 }
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 /**
23 * Gets the image of the first ASTClassOrInterfaceType child or <code>null</code> if none is found.
24 * Note that when the statement is something like throw new Exception, this method
25 * returns 'Exception' and if the throw statement is like throw e: this method returns 'e'.
26 * A special case of returning <code>null</code> is when the throws is like throw this.e or
27 * throw this.
28 * <p/>
29 * TODO - use symbol table (?)
30 *
31 * @return the image of the first ASTClassOrInterfaceType node found or <code>null</code>
32 */
33 public final String getFirstClassOrInterfaceTypeImage() {
34 final ASTClassOrInterfaceType t = getFirstChildOfType(ASTClassOrInterfaceType.class);
35 return t == null ? null : t.getImage();
36 }
37 }