public class MethodHandleGenerator extends java.lang.Object implements IGenerator
IGenerator implementation which calls the handler method using method handles| Constructor and Description |
|---|
MethodHandleGenerator()
Use the
MethodHandles.Lookup of the current ClassLoader |
MethodHandleGenerator(java.lang.invoke.MethodHandles.Lookup lookup) |
| Modifier and Type | Method and Description |
|---|---|
AHandler |
generate(java.lang.Class<?> owner,
java.lang.Object instance,
EventHandler annotation,
java.lang.reflect.Method method,
java.lang.Class<?> arg)
Generate an
AHandler for the given method with an event parameter |
AHandler |
generateVirtual(java.lang.Class<?> owner,
java.lang.Object instance,
EventHandler annotation,
java.lang.reflect.Method method)
Generate an
AHandler for the given method without an event parameter |
public MethodHandleGenerator()
MethodHandles.Lookup of the current ClassLoaderpublic MethodHandleGenerator(@Nonnull
java.lang.invoke.MethodHandles.Lookup lookup)
lookup - The MethodHandles.Lookup to use@Nonnull public AHandler generate(@Nonnull java.lang.Class<?> owner, @Nullable java.lang.Object instance, @Nonnull EventHandler annotation, @Nonnull java.lang.reflect.Method method, @Nonnull java.lang.Class<?> arg)
IGeneratorAHandler for the given method with an event parametergenerate in interface IGeneratorowner - The owner of the handler methodinstance - The instance of the handler ownerannotation - The EventHandler annotation of the handler methodmethod - The handler methodarg - The event class@Nonnull public AHandler generateVirtual(@Nonnull java.lang.Class<?> owner, @Nullable java.lang.Object instance, @Nonnull EventHandler annotation, @Nonnull java.lang.reflect.Method method)
IGeneratorAHandler for the given method without an event parametergenerateVirtual in interface IGeneratorowner - The owner of the handler methodinstance - The instance of the handler ownerannotation - The EventHandler annotation of the handler methodmethod - The handler method