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