Interface CompilationUnitTree

All Superinterfaces:
Tree
All Known Implementing Classes:
JavaTree.CompilationUnitTreeImpl

@Beta public interface CompilationUnitTree extends Tree
Compilation unit. JLS 7.3 and 7.4
Since:
Java 1.3
  • Method Details

    • packageDeclaration

      @Nullable PackageDeclarationTree packageDeclaration()
    • imports

    • types

      List<Tree> types()
    • moduleDeclaration

      @Nullable ModuleDeclarationTree moduleDeclaration()
      Experimental feature allowing retrieval of java 9 module declaration from 'module-info.java' files. In java 9, a new compilation unit level has been introduced, splitting current compilation units between 'Modular' and 'Ordinary' Compilation Units. In order to not introduce breaking change in API too early, and as long as java 9 is not officially released, the 'Module Declaration' part of the Java 9 'Modular Compilation Unit' will be part of the current Compilation Unit interface.
      Since:
      Java 9
    • eofToken

      SyntaxToken eofToken()