ASTThrowStatement.java
01 /* Generated By:JJTree: Do not edit this line. ASTThrowStatement.java */
02 
03 package net.sourceforge.pmd.lang.java.ast;
04 
05 public class ASTThrowStatement extends AbstractJavaNode {
06     public ASTThrowStatement(int id) {
07         super(id);
08     }
09 
10     public ASTThrowStatement(JavaParser p, int id) {
11         super(p, id);
12     }
13 
14 
15     /**
16      * Accept the visitor. *
17      */
18     @Override
19     public Object jjtAccept(JavaParserVisitor visitor, Object data) {
20         return visitor.visit(this, data);
21     }
22 
23     /**
24      * Gets the image of the first ASTClassOrInterfaceType child or <code>null</code> if none is found.
25      * Note that when the statement is something like throw new Exception, this method
26      * returns 'Exception' and if the throw statement is like throw e: this method returns 'e'.
27      * A special case of returning <code>null</code> is when the throws is like throw this.e or
28      * throw this.
29      <p/>
30      * TODO - use symbol table (?)
31      *
32      @return the image of the first ASTClassOrInterfaceType node found or <code>null</code>
33      */
34     public final String getFirstClassOrInterfaceTypeImage() {
35         final ASTClassOrInterfaceType t = getFirstDescendantOfType(ASTClassOrInterfaceType.class);
36         return t == null null : t.getImage();
37     }
38 }