Package de.themoep.hook.core
Class AbstractHookManager<H>
java.lang.Object
de.themoep.hook.core.AbstractHookManager<H>
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractHookManager(String hookPackage) Construct the managerAbstractHookManager(Logger logger, String hookPackage) Construct the managerAbstractHookManager(Logger logger, String hookPackage, boolean onePackagePerHook) Construct the manager -
Method Summary
Modifier and TypeMethodDescriptionGet the Hook from a HookableGet the Hook from the name of a Hookableprotected abstract Collection<H> protected abstract Stringprotected String[]Get the suffix to append to the class name when searching for a hook.protected abstract StringgetVersion(H hookable) protected abstract booleanprotected voidonHookableDisable(H hookable) protected voidonHookableEnable(H hookable) protected voidvoidSet the suffix to append to the class name when searching for a hook.
-
Constructor Details
-
AbstractHookManager
Construct the manager- Parameters:
hookPackage- The package the hooks are in
-
AbstractHookManager
Construct the manager- Parameters:
logger- The custom logger that should be used for errorshookPackage- The package the hooks are in
-
AbstractHookManager
Construct the manager- Parameters:
logger- The custom logger that should be used for errorshookPackage- The package the hooks are inonePackagePerHook- Whether each hook should have its own package named after the hook or not Defaults tofalse
-
-
Method Details
-
registerExistingHookables
protected void registerExistingHookables() -
getHook
Get the Hook from a Hookable- Parameters:
hookable- The hookable to get the hook for- Returns:
- The hook or null
-
getHook
Get the Hook from the name of a Hookable- Parameters:
hookable- The name of the hookable to get the hook for- Returns:
- The hook or null
-
getSuffix
Get the suffix to append to the class name when searching for a hook.- Returns:
- The hook class suffix; defaults to
"Hook"
-
setSuffix
Set the suffix to append to the class name when searching for a hook.- Parameters:
suffix- The hook class suffix; defaults to"Hook"
-
onHookableEnable
-
onHookableDisable
-
getNames
-
getName
-
getVersion
-
isEnabled
-
getHookables
-