com.taco.text
Class CompositeConverter.AbstractCompositeUpdater

java.lang.Object
  extended by com.taco.text.CompositeConverter.AbstractCompositeUpdater
All Implemented Interfaces:
CompositeConverter.ICompositeUpdater, java.beans.PropertyChangeListener, java.util.EventListener
Direct Known Subclasses:
CompositeConverter.CompositeUpdater
Enclosing class:
CompositeConverter

protected abstract static class CompositeConverter.AbstractCompositeUpdater
extends java.lang.Object
implements CompositeConverter.ICompositeUpdater

A useful base class for a listener that updates a composite when the value corresponding to an argument map key changes.


Field Summary
protected  java.lang.Object _composite
          The composite object to update.
protected  IObjectMapper _fromMapValueConverter
          The converter from argument map values to composite property values.
protected  boolean _inPropertyChange
          A flag that indicates we have entered propertyChange() already; detects infinite recursion.
protected  java.lang.String _propertyName
          The name of the property to update.
 
Constructor Summary
CompositeConverter.AbstractCompositeUpdater(java.lang.Object composite, java.lang.String propertyName, IObjectMapper fromMapValueConverter)
           
 
Method Summary
protected  java.lang.Object _makePropertyValue(java.lang.Object mapValue)
          If there is a property value converter, convert mapValue to the property value, and return the result.
 java.lang.Object getComposite()
          Return the composite that this instance updates.
 java.lang.String getPropertyName()
          Return property name of composite that this instance updates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Field Detail

_composite

protected final java.lang.Object _composite
The composite object to update.


_propertyName

protected final java.lang.String _propertyName
The name of the property to update.


_fromMapValueConverter

protected final IObjectMapper _fromMapValueConverter
The converter from argument map values to composite property values.


_inPropertyChange

protected transient boolean _inPropertyChange
A flag that indicates we have entered propertyChange() already; detects infinite recursion.

Constructor Detail

CompositeConverter.AbstractCompositeUpdater

public CompositeConverter.AbstractCompositeUpdater(java.lang.Object composite,
                                                   java.lang.String propertyName,
                                                   IObjectMapper fromMapValueConverter)
Method Detail

getComposite

public java.lang.Object getComposite()
Description copied from interface: CompositeConverter.ICompositeUpdater
Return the composite that this instance updates.

Specified by:
getComposite in interface CompositeConverter.ICompositeUpdater

getPropertyName

public java.lang.String getPropertyName()
Description copied from interface: CompositeConverter.ICompositeUpdater
Return property name of composite that this instance updates.

Specified by:
getPropertyName in interface CompositeConverter.ICompositeUpdater

_makePropertyValue

protected java.lang.Object _makePropertyValue(java.lang.Object mapValue)
If there is a property value converter, convert mapValue to the property value, and return the result. Otherwise, return mapValue unchanged.