EventListenerProxy
Stay organized with collections
Save and categorize content based on your preferences.
Known Direct Subclasses
PropertyChangeListenerProxy |
A class which extends the EventListenerProxy
specifically for adding a PropertyChangeListener
with a "bound" property. |
|
An abstract wrapper class for an EventListener
class
which associates a set of additional parameters with the listener.
Subclasses must provide the storage and accessor methods
for the additional arguments or parameters.
For example, a bean which supports named properties
would have a two argument method signature for adding
a PropertyChangeListener
for a property:
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
If the bean also implemented the zero argument get listener method:
public PropertyChangeListener[] getPropertyChangeListeners()
then the array may contain inner
PropertyChangeListeners
which are also
PropertyChangeListenerProxy
objects.
If the calling method is interested in retrieving the named property
then it would have to test the element to see if it is a proxy class.
Public Constructor Summary
Public Method Summary
T
|
getListener()
Returns the listener associated with the proxy.
|
Inherited Method Summary
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals( Object obj)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long timeout, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long timeout)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
Public Constructors
public
EventListenerProxy
(T listener)
Creates a proxy for the specified listener.
Parameters
listener |
the listener object
|
Public Methods
public
T
getListener
()
Returns the listener associated with the proxy.
Returns
- the listener associated with the proxy
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["`EventListenerProxy` is an abstract wrapper class that associates additional parameters with an `EventListener`."],["It allows associating properties or arguments with listeners, for example, a property name with a `PropertyChangeListener`."],["Subclasses of `EventListenerProxy` need to implement storage and access methods for these additional parameters."],["`EventListenerProxy` provides methods to create a proxy for a listener and to retrieve the original listener associated with the proxy."]]],["`EventListenerProxy` is an abstract class that wraps an `EventListener`, associating it with additional parameters. Subclasses store and access these parameters. It includes a constructor to create a proxy for a listener and a `getListener()` method to retrieve the associated listener. `PropertyChangeListenerProxy` is a subclass. The class manages listeners for named properties and allows testing if an element is a proxy. Methods inherited from the Object class, such as `equals`, `getClass`, and `wait` can also be used.\n"]]