BasePluginFilter (Grails 6.0.0)

Package: org.grails.plugins

## [Java] Class BasePluginFilter

- org.grails.plugins.BasePluginFilter

- All Implemented Interfaces and Traits:
    PluginFilter

      public abstract class BasePluginFilter
      extends java.lang.Object
      implements PluginFilter

  Base functionality shared by `IncludingPluginFilter` and `ExcludingPluginFilter`.

  Authors:
    Phil Zoio

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private java.util.Set<java.lang.String>` | `addedNames` | Temporary field holding list of plugin names added to the filtered List to return (String).
    `private java.util.List<GrailsPlugin>` | `derivedPlugins` | Plugins derivied through a dependency relationship.
    `private java.util.List<GrailsPlugin>` | `explicitlyNamedPlugins` | Plugins corresponding with the supplied names.
    `protected java.util.Map<java.lang.String, GrailsPlugin>` | `nameMap` | Holds a name to GrailsPlugin map (String, Plugin).
    `private java.util.List<GrailsPlugin>` | `originalPlugins` |
    `private java.util.Set<java.lang.String>` | `suppliedNames` | The supplied included plugin names (a String).

  - ### Constructor Summary

    Constructors
    Constructor and description
    `BasePluginFilter (java.util.Set<java.lang.String> suppliedNames)`
    `BasePluginFilter (java.lang.String[] included)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected abstract void` | `addPluginDependencies(java.util.List additionalList, GrailsPlugin plugin)` Defines operation for adding dependencies for a plugin to the list
    `` | `private void` | `buildDerivedPluginList()` Builds list of `GrailsPlugins` which are derived from the `explicitlyNamedPlugins` through a dependency relationship
    `` | `private void` | `buildExplicitlyNamedList()` Returns the sublist of the supplied set who are explicitly named, either as included or excluded plugins
    `` | `private void` | `buildNameMap()` Builds a name to plugin map from the original list of plugins supplied
    `` | `public java.util.List<GrailsPlugin>` | `filterPluginList(java.util.List<GrailsPlugin> original)` Template method shared by subclasses of `BasePluginFilter`.
    `` | `protected java.util.Collection` | `getAllPlugins()`
    `` | `protected GrailsPlugin` | `getNamedPlugin(java.lang.String name)`
    `` | `protected abstract java.util.List<GrailsPlugin>` | `getPluginList(java.util.List original, java.util.List pluginList)` Defines an operation getting the final list to return from the original and derived lists
    `` | `protected java.util.Set<java.lang.String>` | `getSuppliedNames()`
    `` | `protected boolean` | `isDependentOn(GrailsPlugin plugin, java.lang.String pluginName)` Checks whether a plugin is dependent on another plugin with the specified name
    `` | `protected void` | `registerDependency(java.util.List additionalList, GrailsPlugin plugin)` Adds a plugin to the additional if this hasn't happened already

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### private java.util.Set<java.lang.String> addedNames

      Temporary field holding list of plugin names added to the filtered List to return (String).

    - #### private final java.util.List<GrailsPlugin> derivedPlugins

      Plugins derivied through a dependency relationship.

    - #### private final java.util.List<GrailsPlugin> explicitlyNamedPlugins

      Plugins corresponding with the supplied names.

    - #### protected java.util.Map<java.lang.String, GrailsPlugin> nameMap

      Holds a name to GrailsPlugin map (String, Plugin).

    - #### private java.util.List<GrailsPlugin> originalPlugins

    - #### private final java.util.Set<java.lang.String> suppliedNames

      The supplied included plugin names (a String).

  - ### Constructor Detail

    - #### public BasePluginFilter(java.util.Set<java.lang.String> suppliedNames)

    - #### public BasePluginFilter(java.lang.String[] included)

  - ### Method Detail

    - #### @java.lang.SuppressWarnings("rawtypes") protected abstract void addPluginDependencies(java.util.List additionalList, GrailsPlugin plugin)

      Defines operation for adding dependencies for a plugin to the list

    - #### private void buildDerivedPluginList()

      Builds list of `GrailsPlugins` which are derived from the `explicitlyNamedPlugins` through a dependency relationship

    - #### private void buildExplicitlyNamedList()

      Returns the sublist of the supplied set who are explicitly named, either as included or excluded plugins

      Returns:
        a sublist containing the elements of the original list corresponding with the explicitlyNamed items as passed into the constructor

    - #### private void buildNameMap()

      Builds a name to plugin map from the original list of plugins supplied

    - #### public java.util.List<GrailsPlugin> filterPluginList(java.util.List<GrailsPlugin> original)

      Template method shared by subclasses of `BasePluginFilter`.

    - #### @java.lang.SuppressWarnings("rawtypes") protected java.util.Collection getAllPlugins()

    - #### protected GrailsPlugin getNamedPlugin(java.lang.String name)

    - #### @java.lang.SuppressWarnings("rawtypes") protected abstract java.util.List<GrailsPlugin> getPluginList(java.util.List original, java.util.List pluginList)

      Defines an operation getting the final list to return from the original and derived lists

    - #### protected java.util.Set<java.lang.String> getSuppliedNames()

    - #### protected boolean isDependentOn(GrailsPlugin plugin, java.lang.String pluginName)

      Checks whether a plugin is dependent on another plugin with the specified name

      Parameters:
        `plugin` - the plugin to compare
        `pluginName` - the name to compare against
      Returns:
        true if `plugin` depends on `pluginName`

    - #### @java.lang.SuppressWarnings({"unchecked", "rawtypes"}) protected void registerDependency(java.util.List additionalList, GrailsPlugin plugin)

      Adds a plugin to the additional if this hasn't happened already