Interface ICompilationUnit

All Superinterfaces:
IDependent
All Known Implementing Classes:
AssistCompilationUnit, BasicCompilationUnit, ClassFileWorkingCopy, CompilationUnit, CompilationUnit, CompilationUnit, PossibleMatch, ResourceCompilationUnit, SourceFile

public interface ICompilationUnit extends IDependent
This interface denotes a compilation unit, providing its name and content.

Note: This internal interface has been implemented illegally by the org.apache.jasper.glassfish bundle from Orbit, see bug 500211. Avoid changing the API or supply default methods to avoid breaking the Eclipse Help system.

  • Field Summary

    Fields inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.env.IDependent

    JAR_FILE_ENTRY_SEPARATOR
  • Method Summary

    Modifier and Type
    Method
    Description
    char[]
    Answer the contents of the compilation unit.
    default String
     
    default String
    getExternalAnnotationPath​(String qualifiedTypeName)
    Answers a path for external annotations that has been configured for the providing classpath entry, or null.
    char[]
    Answer the name of the top level public type.
    default char[]
    Returns the name of the module to which this compilation unit is associated.
    char[][]
    Answer the name of the package according to the directory structure or null if package consistency checks should be ignored.
    default boolean
    Answer if optional problems should be ignored for this compilation unit.
    module​(LookupEnvironment environment)
    Returns the binding of the module that this compilation unit is associated with.

    Methods inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.env.IDependent

    getFileName
  • Method Details

    • getContents

      char[] getContents()
      Answer the contents of the compilation unit. In normal use, the contents are requested twice. Once during the initial lite parsing step, then again for the more detailed parsing step. Implementors must never return null - return an empty char[] instead, CharOperation.NO_CHAR being the candidate of choice.
    • getMainTypeName

      char[] getMainTypeName()
      Answer the name of the top level public type. For example, {Hashtable}.
    • getPackageName

      char[][] getPackageName()
      Answer the name of the package according to the directory structure or null if package consistency checks should be ignored. For example, {java, lang}.
    • ignoreOptionalProblems

      default boolean ignoreOptionalProblems()
      Answer if optional problems should be ignored for this compilation unit. Implementors should return false if there is no preference.
    • module

      default ModuleBinding module(LookupEnvironment environment)
      Returns the binding of the module that this compilation unit is associated with.
      Returns:
      the binding representing the module.
    • getModuleName

      default char[] getModuleName()
      Returns the name of the module to which this compilation unit is associated. A return value of null signals the unnamed module.
      Returns:
      module name or null for the unnamed module.
    • getDestinationPath

      default String getDestinationPath()
    • getExternalAnnotationPath

      default String getExternalAnnotationPath(String qualifiedTypeName)
      Answers a path for external annotations that has been configured for the providing classpath entry, or null.