public class ListenerEntry
extends java.lang.Object
ListenerEntry is a class that represents a single event handler
of a plugin.| Constructor and Description |
|---|
ListenerEntry(org.bukkit.plugin.Plugin plugin,
org.bukkit.event.Listener listener,
java.lang.reflect.Method method)
Creates a new listener entry for a given method.
|
| Modifier and Type | Method and Description |
|---|---|
org.bukkit.event.Listener |
getListener() |
java.lang.reflect.Method |
getMethod() |
org.bukkit.plugin.Plugin |
getPlugin() |
void |
invoke(org.bukkit.event.Event event)
Tries to invoke the method handler with a given event.
|
void |
invokeUnsafe(org.bukkit.event.Event event)
Tries to invoke the method, but will cast any exceptions to
RuntimeExceptions.
|
boolean |
isCompatibleFor(org.bukkit.event.Event event)
Checks if this method is compatible for a given event type.
|
public ListenerEntry(org.bukkit.plugin.Plugin plugin,
org.bukkit.event.Listener listener,
java.lang.reflect.Method method)
plugin - The plugin that owns the listener.listener - The listener object that contains the method.method - The method to call on events.public org.bukkit.plugin.Plugin getPlugin()
public org.bukkit.event.Listener getListener()
public java.lang.reflect.Method getMethod()
public void invoke(org.bukkit.event.Event event)
throws java.lang.IllegalAccessException,
java.lang.IllegalArgumentException,
java.lang.reflect.InvocationTargetException
event - The event to pass on to the method.java.lang.IllegalAccessException - Can be thrown by the event handler.java.lang.IllegalArgumentException - Can be thrown by the event handler.java.lang.reflect.InvocationTargetException - Can be thrown by the event handler.public void invokeUnsafe(org.bukkit.event.Event event)
event - The event to pass on to the method.public boolean isCompatibleFor(org.bukkit.event.Event event)
event - The event type the handler should be able to handle.true if the handler can handle that event, false if
it can't.