com.github.javaparser.ast.modules.ModuleDirective Maven / Gradle / Ivy
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2021 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast.modules;
import com.github.javaparser.ast.AllFieldsConstructor;
import com.github.javaparser.ast.Generated;
import com.github.javaparser.ast.Node;
import com.github.javaparser.ast.visitor.CloneVisitor;
import com.github.javaparser.TokenRange;
import java.util.function.Consumer;
import static com.github.javaparser.utils.CodeGenerationUtils.f;
import java.util.Optional;
import com.github.javaparser.metamodel.ModuleDirectiveMetaModel;
import com.github.javaparser.metamodel.JavaParserMetaModel;
/**
* A module directive.
*/
public abstract class ModuleDirective extends Node {
@AllFieldsConstructor
public ModuleDirective() {
this(null);
}
/**
* This constructor is used by the parser and is considered private.
*/
@Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator")
public ModuleDirective(TokenRange tokenRange) {
super(tokenRange);
customInitialization();
}
@Override
@Generated("com.github.javaparser.generator.core.node.CloneGenerator")
public ModuleDirective clone() {
return (ModuleDirective) accept(new CloneVisitor(), null);
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public boolean isModuleExportsStmt() {
return false;
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public ModuleExportsDirective asModuleExportsStmt() {
throw new IllegalStateException(f("%s is not an ModuleExportsDirective", this));
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public boolean isModuleOpensStmt() {
return false;
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public ModuleOpensDirective asModuleOpensStmt() {
throw new IllegalStateException(f("%s is not an ModuleOpensDirective", this));
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public boolean isModuleProvidesStmt() {
return false;
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public ModuleProvidesDirective asModuleProvidesStmt() {
throw new IllegalStateException(f("%s is not an ModuleProvidesDirective", this));
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public boolean isModuleRequiresStmt() {
return false;
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public ModuleRequiresDirective asModuleRequiresStmt() {
throw new IllegalStateException(f("%s is not an ModuleRequiresDirective", this));
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public boolean isModuleUsesStmt() {
return false;
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public ModuleUsesDirective asModuleUsesStmt() {
throw new IllegalStateException(f("%s is not an ModuleUsesDirective", this));
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public void ifModuleExportsStmt(Consumer action) {
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public void ifModuleOpensStmt(Consumer action) {
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public void ifModuleProvidesStmt(Consumer action) {
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public void ifModuleRequiresStmt(Consumer action) {
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public void ifModuleUsesStmt(Consumer action) {
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public Optional toModuleExportsStmt() {
return Optional.empty();
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public Optional toModuleOpensStmt() {
return Optional.empty();
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public Optional toModuleProvidesStmt() {
return Optional.empty();
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public Optional toModuleRequiresStmt() {
return Optional.empty();
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public Optional toModuleUsesStmt() {
return Optional.empty();
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public boolean isModuleExportsDirective() {
return false;
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public ModuleExportsDirective asModuleExportsDirective() {
throw new IllegalStateException(f("%s is not ModuleExportsDirective, it is %s", this, this.getClass().getSimpleName()));
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public Optional toModuleExportsDirective() {
return Optional.empty();
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public void ifModuleExportsDirective(Consumer action) {
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public boolean isModuleOpensDirective() {
return false;
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public ModuleOpensDirective asModuleOpensDirective() {
throw new IllegalStateException(f("%s is not ModuleOpensDirective, it is %s", this, this.getClass().getSimpleName()));
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public Optional toModuleOpensDirective() {
return Optional.empty();
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public void ifModuleOpensDirective(Consumer action) {
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public boolean isModuleProvidesDirective() {
return false;
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public ModuleProvidesDirective asModuleProvidesDirective() {
throw new IllegalStateException(f("%s is not ModuleProvidesDirective, it is %s", this, this.getClass().getSimpleName()));
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public Optional toModuleProvidesDirective() {
return Optional.empty();
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public void ifModuleProvidesDirective(Consumer action) {
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public boolean isModuleRequiresDirective() {
return false;
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public ModuleRequiresDirective asModuleRequiresDirective() {
throw new IllegalStateException(f("%s is not ModuleRequiresDirective, it is %s", this, this.getClass().getSimpleName()));
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public Optional toModuleRequiresDirective() {
return Optional.empty();
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public void ifModuleRequiresDirective(Consumer action) {
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public boolean isModuleUsesDirective() {
return false;
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public ModuleUsesDirective asModuleUsesDirective() {
throw new IllegalStateException(f("%s is not ModuleUsesDirective, it is %s", this, this.getClass().getSimpleName()));
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public Optional toModuleUsesDirective() {
return Optional.empty();
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public void ifModuleUsesDirective(Consumer action) {
}
@Override
@Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator")
public ModuleDirectiveMetaModel getMetaModel() {
return JavaParserMetaModel.moduleDirectiveMetaModel;
}
}