de.caff.generics

## Class SoftPropertyChangeListener

- java.lang.Object
- - de.caff.generics.SoftPropertyChangeListener

- All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener

      public class SoftPropertyChangeListener
      extends java.lang.Object
      implements java.beans.PropertyChangeListener

  Wrapper for a property change listener which reference the original change listener softly.

  If the original listener is garbage collected, this property change listener is just doing nothing. Note that although the referenced listener and everything what is attached to it might be released, this listener is still attached to all classes it was added as a property change listener, because it has no chance to know where it was added, so it cannot remove itself.

  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SoftPropertyChangeListener(java.beans.PropertyChangeListener wrapped)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isValid()` Is this listener still valid?
    `void` | `propertyChange(java.beans.PropertyChangeEvent evt)` This method gets called when a bound property is changed.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SoftPropertyChangeListener

          public SoftPropertyChangeListener(@NotNull
                                            java.beans.PropertyChangeListener wrapped)

      Constructor.
      Parameters:
        `wrapped` - listener to wrap, which is only hold via a weak reference

  - ### Method Detail

    - #### propertyChange

          public void propertyChange(java.beans.PropertyChangeEvent evt)

      This method gets called when a bound property is changed.
      Specified by:
        `propertyChange` in interface `java.beans.PropertyChangeListener`
      Parameters:
        `evt` - A PropertyChangeEvent object describing the event source and the property that has changed.

    - #### isValid

          public boolean isValid()

      Is this listener still valid?
      Returns:
        `true` if the reference is still available
        `false` if it is no longer available