com.taco.text
Class CompositeConverter.AbstractMapConsistencyListener

java.lang.Object
  extended by com.taco.text.CompositeConverter.AbstractMapConsistencyListener
All Implemented Interfaces:
CompositeConverter.IMapConsistencyListener
Direct Known Subclasses:
CompositeConverter.DefaultMapConsistencyListener, JTableConverter.AbstractTableMapConsistencyListener
Enclosing class:
CompositeConverter

protected abstract static class CompositeConverter.AbstractMapConsistencyListener
extends java.lang.Object
implements CompositeConverter.IMapConsistencyListener

A useful base class for observable map updaters.


Field Summary
protected  INoReturnMap _argMap
          The map to update.
protected  boolean _inChangeMethod
          A flag that indicates we have already entered the method that responds to the change of one of the composite's properties.
protected  IObjectFilter _listenerFilter
          A filter that rejects updater listeners that update the same property of the same composite.
protected  java.lang.Object _mapKey
          The key of the argument map associated with the updated value.
protected  IObjectMapper _toMapValueConverter
          The converter from the composite property value to the argument map value.
 
Constructor Summary
CompositeConverter.AbstractMapConsistencyListener(java.lang.Object composite, java.lang.String propertyName, INoReturnMap argMap, java.lang.Object mapKey, IObjectMapper toMapValueConverter)
           
 
Method Summary
protected  java.lang.Object _makeMapValue(java.lang.Object propertyValue)
          If there is a map value converter, convert propertyValue to the map value, and return the result.
protected  void _put(java.lang.Object value)
          Convert the value using _makeMapValue().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_argMap

protected final INoReturnMap _argMap
The map to update.


_mapKey

protected final java.lang.Object _mapKey
The key of the argument map associated with the updated value.


_toMapValueConverter

protected final IObjectMapper _toMapValueConverter
The converter from the composite property value to the argument map value.


_listenerFilter

protected final IObjectFilter _listenerFilter
A filter that rejects updater listeners that update the same property of the same composite.


_inChangeMethod

protected transient boolean _inChangeMethod
A flag that indicates we have already entered the method that responds to the change of one of the composite's properties. This flag detects infinite recursion.

Constructor Detail

CompositeConverter.AbstractMapConsistencyListener

public CompositeConverter.AbstractMapConsistencyListener(java.lang.Object composite,
                                                         java.lang.String propertyName,
                                                         INoReturnMap argMap,
                                                         java.lang.Object mapKey,
                                                         IObjectMapper toMapValueConverter)
Method Detail

_put

protected void _put(java.lang.Object value)
             throws java.lang.Exception
Convert the value using _makeMapValue(). Then put the result in the argument map, notifying only listeners that are not updaters.

Throws:
java.lang.Exception

_makeMapValue

protected java.lang.Object _makeMapValue(java.lang.Object propertyValue)
                                  throws java.lang.Exception
If there is a map value converter, convert propertyValue to the map value, and return the result. Otherwise, return propertyValue unchanged.

Throws:
java.lang.Exception