Class NativePropertyListener<S,​D extends IDiff>

  • Type Parameters:
    S - type of the source object
    D - type of the diff handled by this listener
    All Implemented Interfaces:
    INativePropertyListener<S>

    public abstract class NativePropertyListener<S,​D extends IDiff>
    extends Object
    implements INativePropertyListener<S>
    Abstract INativePropertyListener implementation
    Since:
    1.2
    • Constructor Detail

      • NativePropertyListener

        public NativePropertyListener​(IProperty property,
                                      ISimplePropertyListener<S,​D> listener)
        Constructs a NativePropertyListener with the specified arguments
        Parameters:
        property - the property that this listener listens to
        listener - the listener to receive property change notifications
    • Method Detail

      • addTo

        public final void addTo​(S source)
        Description copied from interface: INativePropertyListener
        Adds the receiver as a listener for property events on the specified property source.
        Specified by:
        addTo in interface INativePropertyListener<S>
        Parameters:
        source - the property source (may be null)
      • doAddTo

        protected abstract void doAddTo​(S source)
      • removeFrom

        public final void removeFrom​(S source)
        Description copied from interface: INativePropertyListener
        Removes the receiver as a listener for property events on the specified property source.
        Specified by:
        removeFrom in interface INativePropertyListener<S>
        Parameters:
        source - the property source (may be null)
      • doRemoveFrom

        protected abstract void doRemoveFrom​(S source)
      • fireChange

        protected void fireChange​(S source,
                                  D diff)
        Notifies the listener that a property change occurred on the source object.
        Parameters:
        source - the source object whose property changed
        diff - a diff describing the change in state
      • fireStale

        protected void fireStale​(S source)
        Notifies the listener that the property became stale on the source object.
        Parameters:
        source - the source object whose property became stale