public static class Plugin.Context
extends java.lang.Object
Constructor and Description |
---|
Context(SonarRuntime sonarRuntime)
For unit tests only.
|
Modifier and Type | Method and Description |
---|---|
Plugin.Context |
addExtension(java.lang.Object extension)
|
Plugin.Context |
addExtensions(java.util.Collection extensions) |
Plugin.Context |
addExtensions(java.lang.Object first,
java.lang.Object second,
java.lang.Object... others) |
Configuration |
getBootConfiguration()
The configuration that contains only the few properties required to bootstrap the process, for example:
- conf/sonar.properties and persisted properties on web server and Compute Engine sides.
|
java.util.List |
getExtensions() |
SonarRuntime |
getRuntime()
Runtime environment.
|
Version |
getSonarQubeVersion()
Shortcut on
getRuntime().getApiVersion() since version 6.0. |
public Context(SonarRuntime sonarRuntime)
PluginContextImpl.Builder
to create instances of Plugin.Context
.
The configuration returned by getBootConfiguration()
is empty.public Version getSonarQubeVersion()
getRuntime().getApiVersion()
since version 6.0.getRuntime()
public SonarRuntime getRuntime()
public Plugin.Context addExtension(java.lang.Object extension)
ScannerSide
, ServerSide
or ComputeEngineSide
. The extension will be instantiated once. Its dependencies are
injected through constructor parameters.ScannerSide
, ServerSide
or ComputeEngineSide
.public Plugin.Context addExtensions(java.util.Collection extensions)
addExtension(Object)
public Plugin.Context addExtensions(java.lang.Object first, java.lang.Object second, java.lang.Object... others)
addExtension(Object)
public java.util.List getExtensions()
public Configuration getBootConfiguration()