@Target(value=TYPE) @Retention(value=RUNTIME) @Repeatable(value=Requirements.class) public @interface Requires
minVersion()
).
This prevents NoClassDefFoundErrors
or NoSuchMethodErrors
being thrown when loading or instantiating a plugin class when a JAR containing a plugin it depends on is not present
or on the classpath.
Modifier and Type | Required Element and Description |
---|---|
java.lang.String |
group
The group ID of the plugin being depended on.
|
java.lang.String |
minVersion
The minimum version of the plugin that can be depended on.
|
java.lang.String |
name
The name of the plugin being depended on.
|
public abstract java.lang.String group
public abstract java.lang.String minVersion
For example, if the minimum compatible version is "1.2.3"
and a plugin is present with version
"1.4.6"
, this plugin will be allowed to load since there is a compatible, albeit more recent, version of
the dependency. However, if only version "1.1.1"
is loaded, this plugin cannot be loaded because the loaded
version of the dependency is too old. The same goes if a version "2.2.3"
is loaded; it is too recent and
does not have a backward-compatible API with "1.2.3"
.