Interface DependencyContext
A dependency context is a read-only abstraction of a type/concept that can resolve dependencies between plugins.
This may for example be the server wide plugin manager itself, capable of validating if a dependency exists between
two PluginMeta
instances, however the implementation is not limited to such a concrete use-case.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
hasDependency
(@NotNull String pluginIdentifier) Computes if this dependency context is aware of a dependency that provides/matches the passed identifier.boolean
isTransitiveDependency
(@NotNull PluginMeta plugin, @NotNull PluginMeta depend) Computes if the passedPluginMeta
defined the passed dependency as a transitive dependency.
-
Method Details
-
isTransitiveDependency
boolean isTransitiveDependency(@NotNull @NotNull PluginMeta plugin, @NotNull @NotNull PluginMeta depend) Computes if the passedPluginMeta
defined the passed dependency as a transitive dependency. A transitive dependency, as implied by its name, may not have been configured directly by the passed plugin but could also simply be a dependency of a dependency.A simple example of this method would be
which would returndependencyContext.isTransitiveDependency(pluginMetaA, pluginMetaC);
true
ifpluginMetaA
directly or indirectly depends onpluginMetaC
.- Parameters:
plugin
- the plugin meta this computation should consider the requester of the dependency status for the passed potential dependency.depend
- the potential transitive dependency of theplugin
parameter.- Returns:
- a simple boolean flag indicating if
plugin
considersdepend
as a transitive dependency.
-
hasDependency
Computes if this dependency context is aware of a dependency that provides/matches the passed identifier.A dependency in this methods context is any dependable artefact. It does not matter if anything actually depends on said artefact, its mere existence as a potential dependency is enough for this method to consider it a dependency. If this dependency context is hence aware of an artefact with the matching identifier, this method returns
true
.- Parameters:
pluginIdentifier
- the unique identifier of the dependency with which to probe this dependency context.- Returns:
- a plain boolean flag indicating if this dependency context is aware of a potential dependency with the passed identifier.
-