jpower.event.RegisteredMethod Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JPower Show documentation
Show all versions of JPower Show documentation
Powerful Library for the JVM
package jpower.event;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class RegisteredMethod
{
private final Method method;
public RegisteredMethod(Method method)
{
this.method = method;
}
public void invoke(Object instance, Object event)
{
try
{
method.invoke(instance, event);
}
catch (IllegalAccessException | InvocationTargetException e)
{
}
}
public Class> getEventType()
{
return method.getParameterTypes()[0];
}
}