net.sourceforge.pmd.lang.java.ast.ASTThrowStatement Maven / Gradle / Ivy
The newest version!
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.java.ast;
/**
* A {@code throw} statement.
*
*
*
* ThrowStatement ::= "throw" {@link ASTExpression Expression} ";"
*
*
*/
public final class ASTThrowStatement extends AbstractStatement implements ASTSwitchArrowRHS {
ASTThrowStatement(int id) {
super(id);
}
@Override
protected R acceptVisitor(JavaVisitor super P, ? extends R> visitor, P data) {
return visitor.visit(this, data);
}
/**
* Returns the expression for the thrown exception.
*/
public ASTExpression getExpr() {
return (ASTExpression) getFirstChild();
}
}