public final class PluginUtil extends Object
Plugin
utilities.PluginManager
Modifier and Type | Method and Description |
---|---|
static Map<String,PluginType<?>> |
collectPluginsByCategory(String category)
Shortcut for collecting plugins matching with the given
category . |
static Map<String,PluginType<?>> |
collectPluginsByCategoryAndPackage(String category,
List<String> packages)
Short for collecting plugins matching with the given
category in provided packages . |
static Method |
findPluginFactoryMethod(Class<?> pluginClass)
Finds the
PluginFactory -annotated static method of the given class. |
static <V> V |
instantiatePlugin(Class<V> pluginClass)
Instantiates the given plugin using its no-arg
PluginFactory -annotated static method. |
public static Map<String,PluginType<?>> collectPluginsByCategory(String category)
category
.public static Map<String,PluginType<?>> collectPluginsByCategoryAndPackage(String category, List<String> packages)
category
in provided packages
.public static <V> V instantiatePlugin(Class<V> pluginClass)
PluginFactory
-annotated static method.IllegalStateException
- if instantiation failspublic static Method findPluginFactoryMethod(Class<?> pluginClass)
PluginFactory
-annotated static method of the given class.IllegalStateException
- if no such method could be found Copyright © 1999-2023 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.