All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.pmd.lang.plsql.ast.ASTProgramUnit Maven / Gradle / Ivy

There is a newer version: 7.7.0
Show newest version
/*
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
 */

package net.sourceforge.pmd.lang.plsql.ast;

public final class ASTProgramUnit extends AbstractPLSQLNode implements ExecutableCode, OracleObject {

    ASTProgramUnit(int id) {
        super(id);
    }

    @Override
    protected  R acceptPlsqlVisitor(PlsqlVisitor visitor, P data) {
        return visitor.visit(this, data);
    }

    /**
     * Gets the name of the method.
     *
     * @return a String representing the name of the method
     */
    @Override
    public String getMethodName() {
        ASTMethodDeclarator md = firstChild(ASTMethodDeclarator.class);
        if (md != null) {
            return md.getImage();
        }
        return null;
    }

    public String getName() {
        return getMethodName();
    }

    /**
     * Gets the name of the Oracle Object.
     *
     * @return a String representing the name of the Oracle Object
     */
    @Override
    public String getObjectName() {
        // This _IS_ a schema-level Program Unit
        if (null == this.getParent()) {
            return this.getImage();
        } else {
            return this.getImage();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy