Package io.manebot.plugin.loader
Class PluginLoaderRegistry
- java.lang.Object
-
- io.manebot.plugin.loader.PluginLoaderRegistry
-
public final class PluginLoaderRegistry extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PluginLoaderRegistry()
-
Method Summary
Modifier and Type Method Description PluginLoadergetLoader(java.io.File file)Gets a plugin loader by the specified file.PluginLoadergetLoader(java.lang.String extension)Gets a plugin loader by the specified extension.java.util.Collection<PluginLoader>getRegisteredLoaders()Gets a collection of all currently registered plugin loaders.voidregisterLoader(java.lang.String extension, PluginLoader loader)Registers a plugin loader for a given extension.PluginLoaderunregisterLoader(java.lang.String extension)Unregisters a plugin loader from the system.
-
-
-
Method Detail
-
getRegisteredLoaders
public java.util.Collection<PluginLoader> getRegisteredLoaders()
Gets a collection of all currently registered plugin loaders.- Returns:
- Plugin loader list.
-
registerLoader
public void registerLoader(java.lang.String extension, PluginLoader loader)Registers a plugin loader for a given extension.- Parameters:
extension- extension to map the loader to.loader- loader to map to the extension.
-
unregisterLoader
public PluginLoader unregisterLoader(java.lang.String extension)
Unregisters a plugin loader from the system.- Parameters:
extension- extension to unmap a loader from.- Returns:
- removed PluginLoader instance.
-
getLoader
public PluginLoader getLoader(java.io.File file) throws java.lang.IllegalArgumentException
Gets a plugin loader by the specified file.- Parameters:
file- File to get an associated plugin loader for.- Returns:
- PluginLoader instance responsible for the specified file.
- Throws:
java.lang.IllegalArgumentException- if the file extension is not recognized.
-
getLoader
public PluginLoader getLoader(java.lang.String extension) throws java.lang.IllegalArgumentException
Gets a plugin loader by the specified extension.- Parameters:
extension- Extension to get an associated plugin loader for.- Returns:
- PluginLoader instance responsible for the specified extension.
- Throws:
java.lang.IllegalArgumentException- if the file extension is not recognized.
-
-