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

net.sourceforge.pmd.lang.apex.ast.ASTCatchBlockStatement Maven / Gradle / Ivy

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

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

import com.google.summit.ast.statement.TryStatement;

public final class ASTCatchBlockStatement extends AbstractApexCommentContainerNode {

    ASTCatchBlockStatement(TryStatement.CatchBlock catchBlock) {
        super(catchBlock);
    }


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

    public String getExceptionType() {
        return node.getException().getType().asCodeString();
    }

    public String getVariableName() {
        return node.getException().getDeclarations().get(0).getId().getString();
    }

    public ASTBlockStatement getBody() {
        return firstChild(ASTBlockStatement.class);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy