com.taco.text
Class KeyLookupRecord

java.lang.Object
  extended by com.taco.text.KeyLookupRecord
All Implemented Interfaces:
java.io.Serializable

public class KeyLookupRecord
extends java.lang.Object
implements java.io.Serializable

A data structure used to maintain mappings between argument key names and names of properties which depend on the looking up the key name in an argument map.

See Also:
Serialized Form

Nested Class Summary
static class KeyLookupRecord.KeyDescriptor
          A data structure that holds information on how to associate a key in an argument with a property value of a composite object.
 
Field Summary
protected  java.lang.String _currentPropertyName
          The name of the current property whose value is being created.
protected  java.util.Map _keyToDescriptorMap
          A map from keys for argument maps to instances of KeyDescriptor.
 
Constructor Summary
KeyLookupRecord()
           
 
Method Summary
 KeyLookupRecord clearPropertyName()
          Set the property name to null so any further lookups are not associated with the current property name.
 java.util.Map getKeyToDescriptorMap()
          Return the argument map key to KeyDescriptor map.
 void recordKeyLookup(java.lang.String key, IObjectMapper fromMapValueConverter, IObjectMapper toMapValueConverter, boolean readArgMap, boolean updateArgMap, boolean writeArgMap)
          Record that a lookup in the argument map has taken place using the argument key.
 KeyLookupRecord reset()
          Put this instance back into its initial state.
 KeyLookupRecord setPropertyName(java.lang.String propertyName)
          Associate the next argument map key with propertyName the next time recordKeyLookup() is called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_keyToDescriptorMap

protected final java.util.Map _keyToDescriptorMap
A map from keys for argument maps to instances of KeyDescriptor.


_currentPropertyName

protected java.lang.String _currentPropertyName
The name of the current property whose value is being created.

Constructor Detail

KeyLookupRecord

public KeyLookupRecord()
Method Detail

setPropertyName

public KeyLookupRecord setPropertyName(java.lang.String propertyName)
Associate the next argument map key with propertyName the next time recordKeyLookup() is called. Return this instance.


clearPropertyName

public KeyLookupRecord clearPropertyName()
Set the property name to null so any further lookups are not associated with the current property name. Return this instance.


reset

public KeyLookupRecord reset()
Put this instance back into its initial state. Return this instance.


recordKeyLookup

public void recordKeyLookup(java.lang.String key,
                            IObjectMapper fromMapValueConverter,
                            IObjectMapper toMapValueConverter,
                            boolean readArgMap,
                            boolean updateArgMap,
                            boolean writeArgMap)
Record that a lookup in the argument map has taken place using the argument key. Associate the argument key with the last property name set by setPropertyName(), unless it is null. Set the last property name to null so that it is not reused.


getKeyToDescriptorMap

public java.util.Map getKeyToDescriptorMap()
Return the argument map key to KeyDescriptor map.