getEventClass

fun getEventClass(method: Method): Class<out Event>

Resolves the logical event type associated with this exception-handler signature.

For signatures that declare an event parameter:

this method returns the runtime class of the event parameter (method.parameterTypes[0]) cast to Class<out Event>.

For THROWABLE_ONLY handlers — (throwable: Throwable) — there is no explicit event parameter, so this method returns Event as the key under which the handler should be registered. This allows such handlers to be treated as applicable to all events, with polymorphic matching still applied at dispatch time.

The resulting class is used as the key into exception-handler caches (e.g. exceptionMethodCache) and participates in the normal event-type hierarchy traversal performed by the dispatcher.

Return

the event type under which handlers of this signature kind should be registered.

Parameters

method

the reflective method whose signature is being interpreted.