View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   
5   /* Generated By:JJTree: Do not edit this line. ASTProgramUnit.java Version 4.1 */
6   /* JavaCCOptions:MULTI=true,NODE_USES_PARSER=true,VISITOR=true,TRACK_TOKENS=true,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY= */
7   package net.sourceforge.pmd.lang.plsql.ast;
8   
9   import net.sourceforge.pmd.lang.dfa.DFAGraphMethod;
10  
11  public class ASTProgramUnit extends AbstractPLSQLNode implements ExecutableCode, OracleObject, DFAGraphMethod {
12    public ASTProgramUnit(int id) {
13      super(id);
14    }
15  
16    public ASTProgramUnit(PLSQLParser p, int id) {
17      super(p, id);
18    }
19  
20  
21    /** Accept the visitor. **/
22    public Object jjtAccept(PLSQLParserVisitor visitor, Object data) {
23      return visitor.visit(this, data);
24    }
25  
26    /**
27     * Gets the name of the method.
28     *
29     * @return a String representing the name of the method
30     */
31    @Override
32    public String getMethodName() {
33        ASTMethodDeclarator md = getFirstChildOfType(ASTMethodDeclarator.class);
34        if (md != null) {
35      return md.getImage();
36  	}
37      return null;
38     }
39  
40    @Override
41    public String getName() {
42        return getMethodName();
43    }
44  
45    /**
46     * Gets the name of the Oracle Object.
47     *
48     * @return a String representing the name of the Oracle Object
49     */
50    @Override
51    public String getObjectName() {
52      //This _IS_ a schema-level Program Unit
53      if (null == this.jjtGetParent())
54      {
55        return this.getImage();
56      }
57      else
58      {
59        return this.getImage();
60      }
61     }
62  }
63  /* JavaCC - OriginalChecksum=be7a6f22fbbdc65a66b8033359b677bc (do not edit this line) */