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

net.sourceforge.pmd.lang.plsql.ast.ASTExtractExpression 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;

import java.util.List;

public final class ASTExtractExpression extends AbstractPLSQLNode {
    private boolean xml;

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


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

    void setXml() {
        xml = true;
    }

    public boolean isXml() {
        return xml;
    }

    public String getXPath() {
        if (xml) {
            return firstChild(ASTStringLiteral.class).getString();
        }
        return "";
    }

    public String getNamespace() {
        if (xml) {
            List literals = children(ASTStringLiteral.class).toList();
            if (literals.size() == 2) {
                return literals.get(1).getString();
            }
        }
        return "";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy