Class ModuleLoader
java.lang.Object
eu.locklogin.api.module.plugin.javamodule.ModuleLoader
LockLogin java module loader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable PluginModule
Get a plugin module by nameGet the modules folderstatic @Nullable File
getModuleFile(String name)
Get a module file by its module namestatic Set<PluginModule>
Get a list of the loaded modulesstatic @Nullable PluginModule
getProvidingModule(Class<? extends PluginModule> clazz)
Get a module by its module classstatic boolean
isLoaded(@Nullable PluginModule module)
Check if the module is loadedvoid
loadModule(File moduleFile, LoadRule rule)
Load the specified modulevoid
unloadModule(File moduleFile)
Unload the specified module
-
Constructor Details
-
ModuleLoader
public ModuleLoader()
-
-
Method Details
-
isLoaded
Check if the module is loaded- Parameters:
module
- the module- Returns:
- if the module is loaded
-
getModuleFile
Get a module file by its module name- Parameters:
name
- the module name- Returns:
- the module file
-
getByFile
Get a plugin module by name- Parameters:
moduleFile
- the plugin module file- Returns:
- the plugin module
-
getProvidingModule
@Nullable public static @Nullable PluginModule getProvidingModule(Class<? extends PluginModule> clazz)Get a module by its module class- Parameters:
clazz
- the module class- Returns:
- the plugin module attached to that module clazz
-
getModules
Get a list of the loaded modules- Returns:
- a list of the loaded modules
-
loadModule
Load the specified module- Parameters:
moduleFile
- the module filerule
- the rule the module must have to be loaded
-
unloadModule
Unload the specified module- Parameters:
moduleFile
- the module file
-
getDataFolder
Get the modules folder- Returns:
- the modules folder
-