public abstract class BasePluginFilter extends java.lang.Object implements PluginFilter
Abstract base implementation for plugin filters that start from a supplied set of plugin names, resolve related plugins through dependency traversal, and then delegate the final list assembly to subclasses.
The shared algorithm is:
| Modifiers | Name | Description |
|---|---|---|
protected java.util.Map<java.lang.String, PluginMetadata> |
nameMap |
Lookup of plugin name to plugin metadata for the original plugin list. |
| Constructor and description |
|---|
BasePluginFilter(java.util.Set<java.lang.String> suppliedNames)Creates a filter using the supplied plugin names. |
BasePluginFilter(java.lang.String[] included)Creates a filter using the supplied plugin names. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected abstract void |
addPluginDependencies(java.util.List<PluginMetadata> additionalList, PluginMetadata plugin)Adds any plugins related to the supplied plugin through the dependency rules defined by the subclass. |
|
public java.util.List<PluginMetadata> |
filterPluginList(java.util.List<PluginMetadata> original)Applies this filter to the supplied plugin metadata. |
|
protected java.util.Collection<PluginMetadata> |
getAllPlugins()Returns all plugins from the original input as an unmodifiable collection. |
|
protected PluginMetadata |
getNamedPlugin(java.lang.String name)Looks up a plugin from the original input by name. |
|
protected abstract java.util.List<PluginMetadata> |
getPluginList(java.util.List<PluginMetadata> original, java.util.List<PluginMetadata> pluginList)Builds the final filtered list from the original plugins and the plugins collected by the shared algorithm. |
|
protected java.util.Set<java.lang.String> |
getSuppliedNames()Returns the plugin names supplied to this filter. |
|
protected boolean |
isDependentOn(PluginMetadata plugin, java.lang.String pluginName)Determines whether the supplied plugin declares a dependency on the named plugin. |
|
protected void |
registerDependency(java.util.List<PluginMetadata> additionalList, PluginMetadata plugin)Registers a derived plugin if it has not already been added and continues dependency traversal for it. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Lookup of plugin name to plugin metadata for the original plugin list.
Creates a filter using the supplied plugin names.
suppliedNames - the plugin names that drive the filter resultCreates a filter using the supplied plugin names.
included - the plugin names that drive the filter result; each value is trimmed before useAdds any plugins related to the supplied plugin through the dependency rules defined by the subclass. Implementations are expected to call registerDependency(List, PluginMetadata) to avoid duplicates and to continue recursive traversal.
additionalList - the list collecting plugins discovered indirectlyplugin - the plugin whose related plugins should be consideredApplies this filter to the supplied plugin metadata.
This method performs the shared filtering workflow and then delegates the final list assembly to getPluginList(List, List).
original - the original plugin metadata to filterReturns all plugins from the original input as an unmodifiable collection.
Looks up a plugin from the original input by name.
name - the plugin namenull if none existsBuilds the final filtered list from the original plugins and the plugins collected by the shared algorithm.
original - the full original plugin list supplied to filterPluginList(List)pluginList - the explicit and dependency-derived plugins collected so farReturns the plugin names supplied to this filter.
Determines whether the supplied plugin declares a dependency on the named plugin.
plugin - the plugin to comparepluginName - the name to compare againsttrue if plugin depends on pluginNameRegisters a derived plugin if it has not already been added and continues dependency traversal for it.
additionalList - the list collecting derived pluginsplugin - the plugin to register