com.taco.data
Class WrappedObservableMap.WrappedNotificationStrategy

java.lang.Object
  extended by com.taco.data.WrappedObservableMap.WrappedNotificationStrategy
All Implemented Interfaces:
INotificationStrategy
Enclosing class:
WrappedObservableMap

protected static class WrappedObservableMap.WrappedNotificationStrategy
extends java.lang.Object
implements INotificationStrategy

A notification strategy that wraps another one, used so that when the observable map notifies its listeners, the keys and values it sends to the listeners are suitably unwrapped (they are stored wrapped in the observable map).


Field Summary
protected  INotificationStrategy _decoratee
          The notification strategy wrapped by this instance.
protected  IObjectMapper _keyUnwrapper
          The key unwrapper.
protected  IObjectMapper _valueUnwrapper
          The value unwrapper.
 
Constructor Summary
protected WrappedObservableMap.WrappedNotificationStrategy(INotificationStrategy decoratee, IObjectMapper keyUnwrapper, IObjectMapper valueUnwrapper)
          Construct a new strategy by wrapping the argument strategy.
 
Method Summary
 void notifyListeners(java.lang.Object source, java.lang.Object key, java.lang.Object oldValue, java.lang.Object newValue, java.util.Collection listeners, IObjectFilter listenerFilter)
          Create a new instance of PropertyChangeEvent by unwrapping the key and values, then call notifyListeners() with the event.
 void notifyListeners(java.beans.PropertyChangeEvent event, java.util.Collection listeners, IObjectFilter listenerFilter)
          Notify the listeners using the wrapped strategy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_decoratee

protected INotificationStrategy _decoratee
The notification strategy wrapped by this instance.


_keyUnwrapper

protected IObjectMapper _keyUnwrapper
The key unwrapper.


_valueUnwrapper

protected IObjectMapper _valueUnwrapper
The value unwrapper.

Constructor Detail

WrappedObservableMap.WrappedNotificationStrategy

protected WrappedObservableMap.WrappedNotificationStrategy(INotificationStrategy decoratee,
                                                           IObjectMapper keyUnwrapper,
                                                           IObjectMapper valueUnwrapper)
Construct a new strategy by wrapping the argument strategy. If either keyUnwrapper or valueUnwrapper is null, it will be set to the identity object wrapper.

Method Detail

notifyListeners

public void notifyListeners(java.lang.Object source,
                            java.lang.Object key,
                            java.lang.Object oldValue,
                            java.lang.Object newValue,
                            java.util.Collection listeners,
                            IObjectFilter listenerFilter)
Create a new instance of PropertyChangeEvent by unwrapping the key and values, then call notifyListeners() with the event.

Specified by:
notifyListeners in interface INotificationStrategy

notifyListeners

public void notifyListeners(java.beans.PropertyChangeEvent event,
                            java.util.Collection listeners,
                            IObjectFilter listenerFilter)
Notify the listeners using the wrapped strategy.

Specified by:
notifyListeners in interface INotificationStrategy