Package org.sonar.api.internal
Class SonarRuntimeImpl
- java.lang.Object
-
- org.sonar.api.internal.SonarRuntimeImpl
-
- All Implemented Interfaces:
SonarRuntime
@Immutable public class SonarRuntimeImpl extends java.lang.Object implements SonarRuntime
- Since:
- 6.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SonarRuntime
forSonarLint(Version version)
Create an instance for SonarLint runtime environment.static SonarRuntime
forSonarQube(Version version, SonarQubeSide side, SonarEdition edition)
Create an instance for SonarQube runtime environment.Version
getApiVersion()
Version of API (sonar-plugin-api artifact) at runtime.SonarEdition
getEdition()
The SonarQube/SonarCloud edition being executed at runtime.SonarProduct
getProduct()
The product being executed at runtime.SonarQubeSide
getSonarQubeSide()
The SonarQube/SonarCloud stack being executed at runtime.
-
-
-
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 interfaceSonarRuntime
-
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 interfaceSonarRuntime
-
getSonarQubeSide
public SonarQubeSide getSonarQubeSide()
Description copied from interface:SonarRuntime
The SonarQube/SonarCloud stack being executed at runtime.- Specified by:
getSonarQubeSide
in interfaceSonarRuntime
-
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 interfaceSonarRuntime
-
forSonarQube
public static SonarRuntime forSonarQube(Version version, SonarQubeSide side, SonarEdition edition)
Create an instance for SonarQube runtime environment.
-
forSonarLint
public static SonarRuntime forSonarLint(Version version)
Create an instance for SonarLint runtime environment.
-
-