Interface CompilationUnit

All Known Implementing Classes:
Interface, TopLevelClass, TopLevelEnumeration

public interface CompilationUnit
This interface describes methods common to all Java compilation units (Java classes, interfaces, and enums).
Author:
Jeff Butler
  • Method Details

    • getImportedTypes

      Set<FullyQualifiedJavaType> getImportedTypes()
    • getStaticImports

      Set<String> getStaticImports()
    • getType

    • addImportedType

      void addImportedType(FullyQualifiedJavaType importedType)
    • addImportedTypes

      void addImportedTypes(Set<FullyQualifiedJavaType> importedTypes)
    • addStaticImport

      void addStaticImport(String staticImport)
    • addStaticImports

      void addStaticImports(Set<String> staticImports)
    • addFileCommentLine

      void addFileCommentLine(String commentLine)
      Comments will be written at the top of the file as is, we do not append any start or end comment characters.

      Note that in the Eclipse plugin, file comments will not be merged.

      Parameters:
      commentLine - the comment line
    • getFileCommentLines

      List<String> getFileCommentLines()
    • accept

      <R> R accept(CompilationUnitVisitor<R> visitor)