Class AbstractHookManager<H>

java.lang.Object
de.themoep.hook.core.AbstractHookManager<H>
Direct Known Subclasses:
HookManager, HookManager, HookManager

public abstract class AbstractHookManager<H> extends Object
  • Constructor Details

    • AbstractHookManager

      public AbstractHookManager(String hookPackage)
      Construct the manager
      Parameters:
      hookPackage - The package the hooks are in
    • AbstractHookManager

      public AbstractHookManager(Logger logger, String hookPackage)
      Construct the manager
      Parameters:
      logger - The custom logger that should be used for errors
      hookPackage - The package the hooks are in
    • AbstractHookManager

      public AbstractHookManager(Logger logger, String hookPackage, boolean onePackagePerHook)
      Construct the manager
      Parameters:
      logger - The custom logger that should be used for errors
      hookPackage - The package the hooks are in
      onePackagePerHook - Whether each hook should have its own package named after the hook or not Defaults to false
  • Method Details

    • registerExistingHookables

      protected void registerExistingHookables()
    • getSuffix

      public String getSuffix()
      Get the suffix to append to the class name when searching for a hook.
      Returns:
      The hook class suffix; defaults to "Hook"
    • setSuffix

      public void setSuffix(String suffix)
      Set the suffix to append to the class name when searching for a hook.
      Parameters:
      suffix - The hook class suffix; defaults to "Hook"
    • onHookableEnable

      protected void onHookableEnable(H hookable)
    • onHookableDisable

      protected void onHookableDisable(H hookable)
    • getName

      protected abstract String getName(H hookable)
    • getVersion

      protected abstract String getVersion(H hookable)
    • isEnabled

      protected abstract boolean isEnabled(H hookable)
    • getHookables

      protected abstract Collection<H> getHookables()