org.codehaus.groovy.grails.plugins
Class BasePluginFilter

java.lang.Object
  extended by org.codehaus.groovy.grails.plugins.BasePluginFilter
All Implemented Interfaces:
PluginFilter
Direct Known Subclasses:
ExcludingPluginFilter, IncludingPluginFilter

public abstract class BasePluginFilter
extends Object
implements PluginFilter

Base functionality shared by IncludingPluginFilter and ExcludingPluginFilter.

Author:
Phil Zoio

Field Summary
protected  Map<String,GrailsPlugin> nameMap
          Holds a name to GrailsPlugin map (String, Plugin).
 
Constructor Summary
BasePluginFilter(Set<String> suppliedNames)
           
BasePluginFilter(String[] included)
           
 
Method Summary
protected abstract  void addPluginDependencies(List additionalList, GrailsPlugin plugin)
          Defines operation for adding dependencies for a plugin to the list
 List<GrailsPlugin> filterPluginList(List<GrailsPlugin> original)
          Template method shared by subclasses of BasePluginFilter.
protected  Collection getAllPlugins()
           
protected  GrailsPlugin getNamedPlugin(String name)
           
protected abstract  List<GrailsPlugin> getPluginList(List original, List pluginList)
          Defines an operation getting the final list to return from the original and derived lists
protected  Set<String> getSuppliedNames()
           
protected  boolean isDependentOn(GrailsPlugin plugin, String pluginName)
          Checks whether a plugin is dependent on another plugin with the specified name
protected  void registerDependency(List additionalList, GrailsPlugin plugin)
          Adds a plugin to the additional if this hasn't happened already
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nameMap

protected Map<String,GrailsPlugin> nameMap
Holds a name to GrailsPlugin map (String, Plugin).

Constructor Detail

BasePluginFilter

public BasePluginFilter(Set<String> suppliedNames)

BasePluginFilter

public BasePluginFilter(String[] included)
Method Detail

addPluginDependencies

protected abstract void addPluginDependencies(List additionalList,
                                              GrailsPlugin plugin)
Defines operation for adding dependencies for a plugin to the list


getPluginList

protected abstract List<GrailsPlugin> getPluginList(List original,
                                                    List pluginList)
Defines an operation getting the final list to return from the original and derived lists


filterPluginList

public List<GrailsPlugin> filterPluginList(List<GrailsPlugin> original)
Template method shared by subclasses of BasePluginFilter.

Specified by:
filterPluginList in interface PluginFilter
Parameters:
original - the original supplied set of GrailsPlugin instances
Returns:
a sublist of these items

isDependentOn

protected boolean isDependentOn(GrailsPlugin plugin,
                                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

registerDependency

protected void registerDependency(List additionalList,
                                  GrailsPlugin plugin)
Adds a plugin to the additional if this hasn't happened already


getAllPlugins

protected Collection getAllPlugins()

getNamedPlugin

protected GrailsPlugin getNamedPlugin(String name)

getSuppliedNames

protected Set<String> getSuppliedNames()