Package org.codehaus.janino

# Class Java.ModularCompilationUnit

java.lang.Object
org.codehaus.janino.Java.AbstractCompilationUnit
org.codehaus.janino.Java.ModularCompilationUnit

All Implemented Interfaces:
  `Java.Scope`

Enclosing class:
  `Java`

public static final class Java.ModularCompilationUnit extends Java.AbstractCompilationUnit
Represents a `ModularCompilationUnit` as specified in JLS11 7.3.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.codehaus.janino.Java.AbstractCompilationUnit

`Java.AbstractCompilationUnit.ImportDeclaration, Java.AbstractCompilationUnit.SingleStaticImportDeclaration, Java.AbstractCompilationUnit.SingleTypeImportDeclaration, Java.AbstractCompilationUnit.StaticImportOnDemandDeclaration, Java.AbstractCompilationUnit.TypeImportOnDemandDeclaration`

## Field Summary

Fields
Modifier and Type
Field
Description
`final Java.ModuleDeclaration`
`moduleDeclaration`
The single and mandatory "module declaration" of this modular compilation unit, see JLS9 7.3 and 7.7.

### Fields inherited from class org.codehaus.janino.Java.AbstractCompilationUnit

`fileName, importDeclarations`

## Constructor Summary

Constructors
Constructor
Description
`ModularCompilationUnit(String fileName, Java.AbstractCompilationUnit.ImportDeclaration[] importDeclarations, Java.ModuleDeclaration moduleDeclaration)`

## Method Summary

Modifier and Type
Method
Description
`<R, EX extends Throwable>
R`
`accept(Visitor.AbstractCompilationUnitVisitor<R,EX> visitor)`
Invokes the "`visit...()`" method of `Visitor.AbstractCompilationUnitVisitor` for the concrete `Java.AbstractCompilationUnit` type.

### Methods inherited from class org.codehaus.janino.Java.AbstractCompilationUnit

`getEnclosingScope`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### moduleDeclaration

public final Java.ModuleDeclaration moduleDeclaration
The single and mandatory "module declaration" of this modular compilation unit, see JLS9 7.3 and 7.7.

## Constructor Details

### ModularCompilationUnit

public ModularCompilationUnit(@Nullable String fileName, Java.AbstractCompilationUnit.ImportDeclaration[] importDeclarations, Java.ModuleDeclaration moduleDeclaration)

## Method Details

### accept

@Nullable public <R, EX extends Throwable> R accept(Visitor.AbstractCompilationUnitVisitor<R,EX> visitor) throws EX
Description copied from class: `Java.AbstractCompilationUnit`
Invokes the "`visit...()`" method of `Visitor.AbstractCompilationUnitVisitor` for the concrete `Java.AbstractCompilationUnit` type.

Specified by:
  `accept` in class `Java.AbstractCompilationUnit`
Throws:
  `EX`