public class OrderAwarePluginRegistry<T extends Plugin<S>,S> extends SimplePluginRegistry<T,S>
PluginRegistry implementation that be made aware of a certain ordering of Plugins. By default it
orders Plugins by regarding Ordered interface or
Order annotation. To alter ordering behaviour use one of the factory
methods accepting a Comparator as parameter.| Modifier | Constructor and Description |
|---|---|
protected |
OrderAwarePluginRegistry(List<? extends T> plugins,
Comparator<? super T> comparator)
|
| Modifier and Type | Method and Description |
|---|---|
static <S,T extends Plugin<S>> |
create()
Deprecated.
since 2.0, for removal in 2.1. Prefer
PluginRegistry.empty(). |
static <S,T extends Plugin<S>> |
create(Comparator<? super T> comparator)
Deprecated.
since 2.0, for removal in 2.1. Prefer
PluginRegistry.of(Comparator). |
static <S,T extends Plugin<S>> |
create(List<? extends T> plugins)
Deprecated.
since 2.0, for removal in 2.1. Prefer
PluginRegistry.of(List). |
static <S,T extends Plugin<S>> |
create(List<? extends T> plugins,
Comparator<? super T> comparator)
Deprecated.
since 2.0, for removal in 2.1. Prefer
PluginRegistry.of(List, Comparator). |
static <S,T extends Plugin<S>> |
createReverse(List<? extends T> plugins)
Deprecated.
since 2.0, for removal in 2.1. Prefer
ofReverse(List) |
static <S,T extends Plugin<S>> |
empty()
Creates a new
OrderAwarePluginRegistry using the #DEFAULT_COMPARATOR. |
protected List<T> |
initialize(List<T> plugins)
Callback to initialize the plugin
List. |
static <S,T extends Plugin<S>> |
of(Comparator<? super T> comparator)
|
static <S,T extends Plugin<S>> |
of(List<? extends T> plugins)
Creates a new
OrderAwarePluginRegistry with the given plugins. |
static <S,T extends Plugin<S>> |
of(List<? extends T> plugins,
Comparator<? super T> comparator)
Creates a new
OrderAwarePluginRegistry with the given plugins. |
static <S,T extends Plugin<S>> |
of(T... plugins)
Creates a new
OrderAwarePluginRegistry with the given plugins. |
static <S,T extends Plugin<S>> |
ofReverse(List<? extends T> plugins)
Creates a new
OrderAwarePluginRegistry with the given Plugins and the order of the Plugins
reverted. |
OrderAwarePluginRegistry<T,S> |
reverse()
Returns a new
OrderAwarePluginRegistry with the order of the plugins reverted. |
contains, countPlugins, getPluginFor, getPluginFor, getPluginOrDefaultFor, getPluginOrDefaultFor, getPlugins, getPluginsFor, getPluginsFor, getPluginsFor, getRequiredPluginFor, getRequiredPluginFor, hasPluginForiteratorclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprotected OrderAwarePluginRegistry(List<? extends T> plugins, Comparator<? super T> comparator)
plugins - the Plugins to be contained in the registry or null if the registry shall be
empty initally.comparator - the Comparator to be used for ordering the Plugins or null if the
#DEFAULT_COMPARATOR shall be used.public static <S,T extends Plugin<S>> OrderAwarePluginRegistry<T,S> empty()
OrderAwarePluginRegistry using the #DEFAULT_COMPARATOR.public static <S,T extends Plugin<S>> OrderAwarePluginRegistry<T,S> of(Comparator<? super T> comparator)
comparator - must not be null.@SafeVarargs public static <S,T extends Plugin<S>> OrderAwarePluginRegistry<T,S> of(T... plugins)
OrderAwarePluginRegistry with the given plugins.plugins - must not be null.public static <S,T extends Plugin<S>> OrderAwarePluginRegistry<T,S> of(List<? extends T> plugins)
OrderAwarePluginRegistry with the given plugins.plugins - must not be null.public static <S,T extends Plugin<S>> OrderAwarePluginRegistry<T,S> ofReverse(List<? extends T> plugins)
OrderAwarePluginRegistry with the given Plugins and the order of the Plugins
reverted.plugins - must not be null.public static <S,T extends Plugin<S>> OrderAwarePluginRegistry<T,S> of(List<? extends T> plugins, Comparator<? super T> comparator)
OrderAwarePluginRegistry with the given plugins.plugins - @Deprecated public static <S,T extends Plugin<S>> OrderAwarePluginRegistry<T,S> create()
PluginRegistry.empty().OrderAwarePluginRegistry using the #DEFAULT_COMPARATOR.@Deprecated public static <S,T extends Plugin<S>> OrderAwarePluginRegistry<T,S> create(Comparator<? super T> comparator)
PluginRegistry.of(Comparator).comparator - must not be null.@Deprecated public static <S,T extends Plugin<S>> OrderAwarePluginRegistry<T,S> create(List<? extends T> plugins)
PluginRegistry.of(List).OrderAwarePluginRegistry with the given plugins.plugins - must not be null.@Deprecated public static <S,T extends Plugin<S>> OrderAwarePluginRegistry<T,S> createReverse(List<? extends T> plugins)
ofReverse(List)OrderAwarePluginRegistry with the given Plugins and the order of the Plugins
reverted.plugins - must not be null.@Deprecated public static <S,T extends Plugin<S>> OrderAwarePluginRegistry<T,S> create(List<? extends T> plugins, Comparator<? super T> comparator)
PluginRegistry.of(List, Comparator).OrderAwarePluginRegistry with the given plugins.plugins - must not be null.protected List<T> initialize(List<T> plugins)
PluginRegistrySupportList. Will create a defensive copy of the List to potentially
unwrap a List proxy. Will filter null values from the source list as well.initialize in class PluginRegistrySupport<T extends Plugin<S>,S>plugins - must not be null.public OrderAwarePluginRegistry<T,S> reverse()
OrderAwarePluginRegistry with the order of the plugins reverted.Copyright © 2008–2019 Pivotal Software, Inc.. All rights reserved.