Class HandlerInvoker
java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.HandlerInvoker
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MethodCached handle ofView.onClick(SlotClickContext).static final MethodCached handle ofView.onClose(CloseContext).static final MethodCached handle ofView.onFirstRender(RenderContext).static final MethodCached handle ofView.onInit(ViewConfigBuilder).static final MethodCached handle ofView.onOpen(OpenContext).static final MethodCached handle ofView.onUpdate(UpdateContext). -
Method Summary
Modifier and TypeMethodDescriptionstatic voidInvokes a cached handler on a view, unwrappingInvocationTargetExceptionso the handler's own failure surfaces: unchecked throwables are rethrown as-is and checked ones are wrapped inIllegalStateException.
-
Field Details
-
ON_INIT
Cached handle ofView.onInit(ViewConfigBuilder). -
ON_OPEN
Cached handle ofView.onOpen(OpenContext). -
ON_FIRST_RENDER
Cached handle ofView.onFirstRender(RenderContext). -
ON_UPDATE
Cached handle ofView.onUpdate(UpdateContext). -
ON_CLICK
Cached handle ofView.onClick(SlotClickContext). -
ON_CLOSE
Cached handle ofView.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, unwrappingInvocationTargetExceptionso the handler's own failure surfaces: unchecked throwables are rethrown as-is and checked ones are wrapped inIllegalStateException.- Parameters:
handler- the cached handler method, one of the constants of this classview- the view to dispatch onarg- the single handler argument (builder or per-phase context)- Throws:
IllegalStateException- when the handler throws a checked exception or the reflective dispatch itself fails
-