|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.plugin.core.PluginRegistrySupport<T,S>
org.springframework.plugin.core.SimplePluginRegistry<T,S>
T - the concrete plugin interfaceS - the delimiter typepublic class SimplePluginRegistry<T extends Plugin<S>,S>
Basic implementation of PluginRegistry. Simply holds all given plugins in a list dropping null
values silently on adding.
| Constructor Summary | |
|---|---|
protected |
SimplePluginRegistry(List<? extends T> plugins)
Creates a new SimplePluginRegistry. |
| Method Summary | ||
|---|---|---|
boolean |
contains(T plugin)
Returns whether the registry contains a given plugin. |
|
int |
countPlugins()
Returns the number of registered plugins. |
|
static
|
create()
Creates a new SimplePluginRegistry. |
|
static
|
create(List<? extends T> plugins)
Creates a new SimplePluginRegistry with the given Plugin s. |
|
T |
getPluginFor(S delimiter)
Returns the first plugin found for the given originating system. |
|
|
getPluginFor(S delimiter,
E ex)
Retrieves a required plugin from the registry or throw the given exception if none can be found. |
|
T |
getPluginFor(S delimiter,
T plugin)
Returns the first Plugin supporting the given delimiter or the given plugin if none can be found. |
|
List<T> |
getPlugins()
Returns all registered plugins. |
|
List<T> |
getPluginsFor(S delimiter)
Returns all plugins for the given delimiter. |
|
|
getPluginsFor(S delimiter,
E ex)
Retrieves all plugins for the given delimiter or throws an exception if no plugin can be found. |
|
List<T> |
getPluginsFor(S delimiter,
List<? extends T> plugins)
Returns all Plugins supporting the given delimiter or the given plugins if none found. |
|
boolean |
hasPluginFor(S delimiter)
Returns whether the registry contains a Plugin matching the given delimiter. |
|
| Methods inherited from class org.springframework.plugin.core.PluginRegistrySupport |
|---|
initialize, iterator |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SimplePluginRegistry(List<? extends T> plugins)
SimplePluginRegistry. Will create an empty registry if null is provided.
plugins - must not be null.| Method Detail |
|---|
public static <S,T extends Plugin<S>> SimplePluginRegistry<T,S> create()
SimplePluginRegistry.
T - the plugin typeS - the delimiter type
public static <S,T extends Plugin<S>> SimplePluginRegistry<T,S> create(List<? extends T> plugins)
SimplePluginRegistry with the given Plugin s.
T - the plugin typeS - the delimiter type
public List<T> getPlugins()
PluginRegistrySupport
getPlugins in interface PluginRegistry<T extends Plugin<S>,S>getPlugins in class PluginRegistrySupport<T extends Plugin<S>,S>public T getPluginFor(S delimiter)
PluginRegistry
null if none foundpublic List<T> getPluginsFor(S delimiter)
PluginRegistry
public <E extends Exception> T getPluginFor(S delimiter,
E ex)
throws E extends Exception
PluginRegistry
E - the exception type to be thrown in case no plugin can be foundex - the exception to be thrown in case no plugin can be found
E - if no plugin can be found for the given delimiter
E extends Exception
public <E extends Exception> List<T> getPluginsFor(S delimiter,
E ex)
throws E extends Exception
PluginRegistry
E - the exception type to be thrown
E - if no plugin can be found
E extends Exception
public T getPluginFor(S delimiter,
T plugin)
PluginRegistryPlugin supporting the given delimiter or the given plugin if none can be found.
Plugin supporting the given delimiter or the given Plugin if none found
public List<T> getPluginsFor(S delimiter,
List<? extends T> plugins)
PluginRegistryPlugins supporting the given delimiter or the given plugins if none found.
Plugins supporting the given delimiter or the given Plugins if none foundpublic int countPlugins()
PluginRegistry
public boolean contains(T plugin)
PluginRegistry
public boolean hasPluginFor(S delimiter)
PluginRegistryPlugin matching the given delimiter.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||