Interface ModuleScannerContext

All Known Subinterfaces:
InputFileScannerContext, JavaFileScannerContext
All Known Implementing Classes:
DefaultInputFileScannerContext, DefaultJavaFileScannerContext, DefaultModuleScannerContext, JavaFileScannerContextForTests

public interface ModuleScannerContext
  • Method Details

    • addIssueOnProject

      void addIssueOnProject(JavaCheck check, String message)
      Report an issue at the project level.
      Parameters:
      check - The check raising the issue.
      message - Message to display to the user
      Since:
      SonarJava 5.12: Dropping support of file-related methods
    • getProject

      org.sonar.api.batch.fs.InputComponent getProject()
      InputComponent representing the project being analyzed
      Returns:
      the project component
      Since:
      SonarJava 5.12: Dropping support of file-related methods
    • getWorkingDirectory

      @Deprecated(since="7.12") File getWorkingDirectory()
      Deprecated.
      The working directory used by the analysis.
      Returns:
      the current working directory.
    • getJavaVersion

      JavaVersion getJavaVersion()
      Java version defined for the analysis using sonar.java.version parameter.
      Returns:
      JavaVersion object with API to act on it.
    • inAndroidContext

      boolean inAndroidContext()
      To be used to know if the current file is in an android context or not. This value is determined thanks to the presence of android classes in the classpath.
      Returns:
      true if the current file is in an android context.
    • getCacheContext

      CacheContext getCacheContext()
      Returns:
      the CacheContext applicable to this scan.
    • getRootProjectWorkingDirectory

      File getRootProjectWorkingDirectory()
      Returns:
      The working directory used by the analysis on project-level. Even if the project contains multiple modules, this method will always return the same value.
    • getModuleKey

      String getModuleKey()
      Returns:
      A key that uniquely identifies the current module, provided that this project consists of multiple modules.