net.sourceforge.pmd.lang.java.ast.ASTEnumDeclaration 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;
import net.sourceforge.pmd.lang.ast.Node;
/**
* Represents an enum declaration.
* This is a {@linkplain Node#isFindBoundary() find boundary} for tree traversal methods.
*
* An enum declaration is implicitly final unless it contains at
* least one enum constant that has a class body. A nested enum type
* is implicitly static.
*
*
*
* EnumDeclaration ::= {@link ASTModifierList ModifierList}
* "enum"
* <IDENTIFIER>
* {@linkplain ASTImplementsList ImplementsList}?
* {@link ASTEnumBody EnumBody}
*
*
*/
public final class ASTEnumDeclaration extends AbstractTypeDeclaration {
ASTEnumDeclaration(int id) {
super(id);
}
@Override
protected R acceptVisitor(JavaVisitor super P, ? extends R> visitor, P data) {
return visitor.visit(this, data);
}
@Override
public ASTEnumBody getBody() {
return (ASTEnumBody) getLastChild();
}
}