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

net.sourceforge.pmd.lang.java.ast.ASTModuleRequiresDirective 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.java.ast;

import java.util.Objects;

import org.checkerframework.checker.nullness.qual.NonNull;

/**
 * A "requires"  directive of a {@linkplain ASTModuleDeclaration module declaration}.
 *
 * 
 *
 * ModuleRequiresDirective ::=
 *     "requires" ( "transitive" | "static" )? {@linkplain ASTModuleName ModuleName} ";"
 *
 * 
*/ public final class ASTModuleRequiresDirective extends ASTModuleDirective { private boolean isStatic; private boolean isTransitive; ASTModuleRequiresDirective(int id) { super(id); } @Override protected R acceptVisitor(JavaVisitor visitor, P data) { return visitor.visit(this, data); } /** * Returns the name of the required module. */ public @NonNull ASTModuleName getRequiredModule() { return Objects.requireNonNull(firstChild(ASTModuleName.class)); } public boolean isStatic() { return isStatic; } public boolean isTransitive() { return isTransitive; } void setTransitive() { isTransitive = true; } void setStatic() { isStatic = true; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy