T
- the type of events this listener can processpublic interface EventListener<T extends Event>
Definition of a generic event listener interface.
This event listener interface is used throughout the Commons Configuration library for reacting on all kinds
of supported events. The interface is pretty minimalistic, defining only a single onEvent()
method. This
simplifies the implementation of custom event listeners and also supports the new language features introduced with
Java 8 (EventListener
is a functional interface and thus can be represented by a Lambda expression).
Modifier and Type | Method and Description |
---|---|
void |
onEvent(T event)
Notifies this event listener about the arrival of a new event.
|
void onEvent(T event)
EventType
. This event type acts as a filter; all events matched by the filter are passed
to the listener. The type parameters defined by the EventType
class and this interface guarantee that the
events delivered to the handler are compatible with the concrete method signature of onEvent()
.event
- the eventCopyright © 2001–2022 The Apache Software Foundation. All rights reserved.