Class SonarRuntimeImpl

  • All Implemented Interfaces:
    SonarRuntime

    @Immutable
    public class SonarRuntimeImpl
    extends java.lang.Object
    implements SonarRuntime
    Since:
    6.0
    • Method Detail

      • getApiVersion

        public Version getApiVersion()
        Description copied from interface: SonarRuntime
        Version of API (sonar-plugin-api artifact) at runtime. It can be helpful to call some API classes/methods without checking their availability at runtime by using reflection.
        Since 6.3, the returned version includes the build number in the fourth field, for example "6.3.0.12345".
        Specified by:
        getApiVersion in interface SonarRuntime
      • getProduct

        public SonarProduct getProduct()
        Description copied from interface: SonarRuntime
        The product being executed at runtime. It targets analysers so that they can implement different behaviours in SonarQube/SonarCloud and SonarLint.
        Specified by:
        getProduct in interface SonarRuntime
      • getEdition

        public SonarEdition getEdition()
        Description copied from interface: SonarRuntime
        The SonarQube/SonarCloud edition being executed at runtime. Note that there is a specific edition for SonarCloud.
        Specified by:
        getEdition in interface SonarRuntime
      • forSonarLint

        public static SonarRuntime forSonarLint​(Version version)
        Create an instance for SonarLint runtime environment.