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."],[[["\u003cp\u003e\u003ccode\u003eEventListenerProxy\u003c/code\u003e is an abstract wrapper class that associates additional parameters with an \u003ccode\u003eEventListener\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt allows associating properties or arguments with listeners, for example, a property name with a \u003ccode\u003ePropertyChangeListener\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSubclasses of \u003ccode\u003eEventListenerProxy\u003c/code\u003e need to implement storage and access methods for these additional parameters.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eEventListenerProxy\u003c/code\u003e provides methods to create a proxy for a listener and to retrieve the original listener associated with the proxy.\u003c/p\u003e\n"]]],["`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"],null,["# EventListenerProxy\n\npublic abstract class **EventListenerProxy** extends [Object](../../../reference/java/lang/Object.html) \nimplements [EventListener](../../../reference/java/util/EventListener.html) \n\n|---|---|---|\n| Known Direct Subclasses [PropertyChangeListenerProxy](../../../reference/java/beans/PropertyChangeListenerProxy.html) |-----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------| | [PropertyChangeListenerProxy](../../../reference/java/beans/PropertyChangeListenerProxy.html) | A class which extends the `EventListenerProxy` specifically for adding a `PropertyChangeListener` with a \"bound\" property. | |||\n\nAn abstract wrapper class for an `EventListener` class\nwhich associates a set of additional parameters with the listener.\nSubclasses must provide the storage and accessor methods\nfor the additional arguments or parameters.\n\n\nFor example, a bean which supports named properties\nwould have a two argument method signature for adding\na `PropertyChangeListener` for a property: \n\n```\n public void addPropertyChangeListener(String propertyName,\n PropertyChangeListener listener)\n \n```\nIf the bean also implemented the zero argument get listener method: \n\n```\n public PropertyChangeListener[] getPropertyChangeListeners()\n \n```\nthen the array may contain inner `PropertyChangeListeners` which are also `PropertyChangeListenerProxy` objects.\n\n\nIf the calling method is interested in retrieving the named property\nthen it would have to test the element to see if it is a proxy class. \n\n### Public Constructor Summary\n\n|---|----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [EventListenerProxy](../../../reference/java/util/EventListenerProxy.html#EventListenerProxy(T))(T listener) Creates a proxy for the specified listener. |\n\n### Public Method Summary\n\n|---|-------------------------------------------------------------------------------------------------------------------------------------|\n| T | [getListener](../../../reference/java/util/EventListenerProxy.html#getListener())() Returns the listener associated with the proxy. |\n\n### Inherited Method Summary\n\nFrom class [java.lang.Object](../../../reference/java/lang/Object.html) \n\n|-------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Object](../../../reference/java/lang/Object.html) | [clone](../../../reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |\n| boolean | [equals](../../../reference/java/lang/Object.html#equals(java.lang.Object))([Object](../../../reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |\n| void | [finalize](../../../reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |\n| final [Class](../../../reference/java/lang/Class.html)\\\u003c?\\\u003e | [getClass](../../../reference/java/lang/Object.html#getClass())() Returns the unique instance of [Class](../../../reference/java/lang/Class.html) that represents this object's class. |\n| int | [hashCode](../../../reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |\n| final void | [notify](../../../reference/java/lang/Object.html#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. |\n| final void | [notifyAll](../../../reference/java/lang/Object.html#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. |\n| [String](../../../reference/java/lang/String.html) | [toString](../../../reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |\n| final void | [wait](../../../reference/java/lang/Object.html#wait(long,%20int))(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. |\n| final void | [wait](../../../reference/java/lang/Object.html#wait(long))(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. |\n| final void | [wait](../../../reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |\n\nPublic Constructors\n-------------------\n\n#### public\n**EventListenerProxy**\n(T listener)\n\nCreates a proxy for the specified listener. \n\n##### Parameters\n\n| listener | the listener object |\n|----------|---------------------|\n\nPublic Methods\n--------------\n\n#### public T\n**getListener**\n()\n\nReturns the listener associated with the proxy. \n\n##### Returns\n\n- the listener associated with the proxy"]]