java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.HandlerInvoker

@Internal public final class HandlerInvoker extends Object
Reflective dispatcher for the protected View lifecycle handlers. Every handler Method is resolved and made accessible once in the static initializer, so the engine phases and the registry share one cached handle per handler instead of resolving it on every dispatch.
  • Field Details

    • ON_INIT

      public static final Method ON_INIT
      Cached handle of View.onInit(ViewConfigBuilder).
    • ON_OPEN

      public static final Method ON_OPEN
      Cached handle of View.onOpen(OpenContext).
    • ON_FIRST_RENDER

      public static final Method ON_FIRST_RENDER
      Cached handle of View.onFirstRender(RenderContext).
    • ON_UPDATE

      public static final Method ON_UPDATE
      Cached handle of View.onUpdate(UpdateContext).
    • ON_CLICK

      public static final Method ON_CLICK
      Cached handle of View.onClick(SlotClickContext).
    • ON_CLOSE

      public static final Method ON_CLOSE
      Cached handle of View.onClose(CloseContext).
  • Method Details

    • invoke

      public static void invoke(@NotNull @NotNull Method handler, @NotNull @NotNull View view, @NotNull @NotNull Object arg)
      Invokes a cached handler on a view, unwrapping InvocationTargetException so the handler's own failure surfaces: unchecked throwables are rethrown as-is and checked ones are wrapped in IllegalStateException.
      Parameters:
      handler - the cached handler method, one of the constants of this class
      view - the view to dispatch on
      arg - the single handler argument (builder or per-phase context)
      Throws:
      IllegalStateException - when the handler throws a checked exception or the reflective dispatch itself fails