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 SonarRuntimeforSonarLint(Version version)Create an instance for SonarLint runtime environment.static SonarRuntimeforSonarQube(Version version, SonarQubeSide side, SonarEdition edition)Create an instance for SonarQube runtime environment.VersiongetApiVersion()Version of API (sonar-plugin-api artifact) at runtime.SonarEditiongetEdition()The SonarQube/SonarCloud edition being executed at runtime.SonarProductgetProduct()The product being executed at runtime.SonarQubeSidegetSonarQubeSide()The SonarQube/SonarCloud stack being executed at runtime.
-
-
-
Method Detail
-
getApiVersion
public Version getApiVersion()
Description copied from interface:SonarRuntimeVersion 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:
getApiVersionin interfaceSonarRuntime
-
getProduct
public SonarProduct getProduct()
Description copied from interface:SonarRuntimeThe product being executed at runtime. It targets analysers so that they can implement different behaviours in SonarQube/SonarCloud and SonarLint.- Specified by:
getProductin interfaceSonarRuntime
-
getSonarQubeSide
public SonarQubeSide getSonarQubeSide()
Description copied from interface:SonarRuntimeThe SonarQube/SonarCloud stack being executed at runtime.- Specified by:
getSonarQubeSidein interfaceSonarRuntime
-
getEdition
public SonarEdition getEdition()
Description copied from interface:SonarRuntimeThe SonarQube/SonarCloud edition being executed at runtime. Note that there is a specific edition for SonarCloud.- Specified by:
getEditionin 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.
-
-