Interface PluginAware
-
public interface PluginAwareSomething that can have plugins applied to it.The
plugin managercan be used for applying and detecting whether plugins have been applied.For more on writing and applying plugins, see
Plugin.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapply(Closure closure)Applies zero or more plugins or scripts.voidapply(java.util.Map<java.lang.String,?> options)Applies a plugin or script, using the given options provided as a map.voidapply(Action<? super ObjectConfigurationAction> action)Applies zero or more plugins or scripts.PluginManagergetPluginManager()The plugin manager for this plugin aware object.PluginContainergetPlugins()The container of plugins that have been applied to this object.
-
-
-
Method Detail
-
getPlugins
PluginContainer getPlugins()
The container of plugins that have been applied to this object.While not deprecated, it is preferred to use the methods of this interface or the
plugin managerthan use the plugin container.Use one of the 'apply' methods on this interface or on the
plugin managerto apply plugins instead of applying via the plugin container.Use
PluginManager.hasPlugin(String)or similar to query for the application of plugins instead of doing so via the plugin container.- Returns:
- the plugin container
- See Also:
apply(groovy.lang.Closure),PluginManager.hasPlugin(String)
-
apply
void apply(@DelegatesTo(ObjectConfigurationAction.class) Closure closure)
Applies zero or more plugins or scripts.The given closure is used to configure an
ObjectConfigurationAction, which “builds” the plugin application.This method differs from
apply(java.util.Map)in that it allows methods of the configuration action to be invoked more than once.- Parameters:
closure- the closure to configure anObjectConfigurationActionwith before “executing” it- See Also:
apply(java.util.Map)
-
apply
void apply(Action<? super ObjectConfigurationAction> action)
Applies zero or more plugins or scripts.The given closure is used to configure an
ObjectConfigurationAction, which “builds” the plugin application.This method differs from
apply(java.util.Map)in that it allows methods of the configuration action to be invoked more than once.- Parameters:
action- the action to configure anObjectConfigurationActionwith before “executing” it- See Also:
apply(java.util.Map)
-
apply
void apply(java.util.Map<java.lang.String,?> options)
Applies a plugin or script, using the given options provided as a map. Does nothing if the plugin has already been applied.The given map is applied as a series of method calls to a newly created
ObjectConfigurationAction. That is, each key in the map is expected to be the name of a methodObjectConfigurationActionand the value to be compatible arguments to that method.The following options are available:
from: A script to apply. Accepts any path supported byProject.uri(Object).plugin: The id or implementation class of the plugin to apply.to: The target delegate object or objects. The default is this plugin aware object. Use this to configure objects other than this object.
- Parameters:
options- the options to use to configure andObjectConfigurationActionbefore “executing” it
-
getPluginManager
PluginManager getPluginManager()
The plugin manager for this plugin aware object.- Returns:
- the plugin manager
- Since:
- 2.3
-
-