Prepare the project for javadocs
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
package fr.xephi.authme.modules;
|
||||
|
||||
/**
|
||||
*/
|
||||
public abstract class Module {
|
||||
|
||||
/**
|
||||
*/
|
||||
enum ModuleType {
|
||||
MANAGER,
|
||||
MYSQL,
|
||||
@@ -12,8 +16,16 @@ public abstract class Module {
|
||||
CUSTOM
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getName.
|
||||
* @return String
|
||||
*/
|
||||
public abstract String getName();
|
||||
|
||||
/**
|
||||
* Method getType.
|
||||
* @return ModuleType
|
||||
*/
|
||||
public abstract ModuleType getType();
|
||||
|
||||
public void load() {
|
||||
|
||||
@@ -15,13 +15,24 @@ import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ModuleManager {
|
||||
|
||||
private List<Module> modules = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Constructor for ModuleManager.
|
||||
* @param plugin AuthMe
|
||||
*/
|
||||
public ModuleManager(AuthMe plugin) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isModuleEnabled.
|
||||
* @param name String
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isModuleEnabled(String name) {
|
||||
for (Module m : modules) {
|
||||
if (m.getName().equalsIgnoreCase(name))
|
||||
@@ -30,6 +41,11 @@ public class ModuleManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isModuleEnabled.
|
||||
* @param type Module.ModuleType
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isModuleEnabled(Module.ModuleType type) {
|
||||
for (Module m : modules) {
|
||||
if (m.getType() == type)
|
||||
@@ -38,6 +54,11 @@ public class ModuleManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getModule.
|
||||
* @param name String
|
||||
* @return Module
|
||||
*/
|
||||
public Module getModule(String name) {
|
||||
for (Module m : modules) {
|
||||
if (m.getName().equalsIgnoreCase(name))
|
||||
@@ -46,6 +67,11 @@ public class ModuleManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getModule.
|
||||
* @param type Module.ModuleType
|
||||
* @return Module
|
||||
*/
|
||||
public Module getModule(Module.ModuleType type) {
|
||||
for (Module m : modules) {
|
||||
if (m.getType() == type)
|
||||
@@ -54,6 +80,10 @@ public class ModuleManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method loadModules.
|
||||
* @return int
|
||||
*/
|
||||
public int loadModules() {
|
||||
File dir = Settings.MODULE_FOLDER;
|
||||
int count = 0;
|
||||
@@ -117,6 +147,10 @@ public class ModuleManager {
|
||||
loadModules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method unloadModule.
|
||||
* @param name String
|
||||
*/
|
||||
public void unloadModule(String name) {
|
||||
Iterator<Module> it = modules.iterator();
|
||||
while (it.hasNext()) {
|
||||
|
||||
Reference in New Issue
Block a user