public interface MethodEventSource extends Serializable
Interface for classes supporting registration of methods as event receivers.
For more information on the inheritable event mechanism see the
com.vaadin.event package documentation
.
Modifier and Type | Method and Description |
---|---|
Registration |
addListener(Class<?> eventType,
Object object,
Method method)
Registers a new event listener with the specified activation method to
listen events generated by this component.
|
Registration |
addListener(Class<?> eventType,
Object object,
String methodName)
Registers a new listener with the specified activation method to listen
events generated by this component.
|
void |
removeListener(Class<?> eventType,
Object target)
Removes all registered listeners matching the given parameters.
|
void |
removeListener(Class<?> eventType,
Object target,
Method method)
Deprecated.
use a
Registration returned by
addListener(Class, Object, Method) |
void |
removeListener(Class<?> eventType,
Object target,
String methodName)
Deprecated.
use a
Registration returned by
addListener(Class, Object, String) |
Registration addListener(Class<?> eventType, Object object, Method method)
For more information on the inheritable event mechanism see the
com.vaadin.event package documentation
.
eventType
- the type of the listened event. Events of this type or its
subclasses activate the listener.object
- the object instance who owns the activation method.method
- the activation method.IllegalArgumentException
- unless method
has exactly one match in
object
NullPointerException
- if object
is null
Registration addListener(Class<?> eventType, Object object, String methodName)
This version of addListener
gets the name of the activation
method as a parameter. The actual method is reflected from
object
, and unless exactly one match is found,
java.lang.IllegalArgumentException
is thrown.
For more information on the inheritable event mechanism see the
com.vaadin.event package documentation
.
eventType
- the type of the listened event. Events of this type or its
subclasses activate the listener.object
- the object instance who owns the activation method.methodName
- the name of the activation method.IllegalArgumentException
- unless method
has exactly one match in
object
NullPointerException
- if object
is null
void removeListener(Class<?> eventType, Object target)
object
's methods that are
registered to listen to events of type eventType
generated
by this component.
For more information on the inheritable event mechanism see the
com.vaadin.event package documentation
.
eventType
- the exact event type the object
listens to.target
- the target object that has registered to listen to events of
type eventType
with one or more methods.@Deprecated void removeListener(Class<?> eventType, Object target, Method method)
Registration
returned by
addListener(Class, Object, Method)
For more information on the inheritable event mechanism see the
com.vaadin.event package documentation
.
eventType
- the exact event type the object
listens to.target
- the target object that has registered to listen to events of
type eventType with one or more methods.method
- the method owned by the target that's registered to listen to
events of type eventType.@Deprecated void removeListener(Class<?> eventType, Object target, String methodName)
Registration
returned by
addListener(Class, Object, String)
This version of removeListener
gets the name of the
activation method as a parameter. The actual method is reflected from the
target, and unless exactly one match is found,
java.lang.IllegalArgumentException
is thrown.
For more information on the inheritable event mechanism see the
com.vaadin.event package documentation
.
eventType
- the exact event type the object
listens to.target
- the target object that has registered to listen to events of
type eventType
with one or more methods.methodName
- the name of the method owned by target
that's
registered to listen to events of type eventType
.Copyright © 2018 Vaadin Ltd. All rights reserved.