commoble.databuddy.plugin

## Class PluginLoader

- java.lang.Object
- - commoble.databuddy.plugin.PluginLoader

    public class PluginLoader
    extends java.lang.Object

### Constructor Summary

Constructors
Constructor and Description
`PluginLoader()`

### Method Summary

All Methods Static Methods Concrete Methods

`static <REGISTRATOR,PLUGIN extends java.util.function.Consumer<REGISTRATOR>,REGISTRY extends REGISTRATOR>
REGISTRY`

`loadPlugins(java.lang.Class<?> annotationClass, java.lang.Class<PLUGIN> pluginInterface, REGISTRY registrator, org.apache.logging.log4j.Logger logger, java.lang.String loggerName)`
Gathers all classes that implement the given interface and are annotated with the given annotation, attempts to make one instance of each of these classes, and registers them to some plugin-registering object.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PluginLoader

    public PluginLoader()

### Method Detail

#### loadPlugins

    public static <REGISTRATOR,PLUGIN extends java.util.function.Consumer<REGISTRATOR>,REGISTRY extends REGISTRATOR> REGISTRY loadPlugins(java.lang.Class<?> annotationClass,
                                                                                                                                          java.lang.Class<PLUGIN> pluginInterface,
                                                                                                                                          REGISTRY registrator,
                                                                                                                                          org.apache.logging.log4j.Logger logger,
                                                                                                                                          java.lang.String loggerName)

Gathers all classes that implement the given interface and are annotated with the given annotation, attempts to make one instance of each of these classes, and registers them to some plugin-registering object.

In this manner, a mod that uses the plugin loader can grant API access to other mods if the API mod is present.

Classes that implement the given PLUGIN interface and are annotated with the given annotation must have an argless constructor, or that plugin will fail to load. Plugins that fail to load will be caught and logged.

Type Parameters:
  `REGISTRATOR` - Interface that plugins can consume
  `PLUGIN` - Plugin interface type. Must be able to consume REGISTRATORS.
  `REGISTRY` - Implementation type of REGISTRATOR to register plugins to
Parameters:
  `annotationClass` - Annotation class that the class scanner will look for
  `pluginInterface` - Registrator-consuming interface class
  `registrator` - The object to give to plugins so they can register things to it
  `logger` - A logger to log plugin-loading information with
  `loggerName` - A name used by the logger, can be your modid
Returns:
  The registrator instance that was given, after