com.taco.text
Class ChainedInterpolatingConverter

java.lang.Object
  extended by com.taco.text.ChainedInterpolatingConverter
All Implemented Interfaces:
IInterpolatingConverter, IInterpolatingStringToObjectConverter, IInterpolatingResourceBundleToObjectConverter
Direct Known Subclasses:
TreePathConverter

public class ChainedInterpolatingConverter
extends java.lang.Object
implements IInterpolatingConverter

A converter based on another converter, which has its value converted by an implementation of IObjectMapper.


Field Summary
protected  IInterpolatingConverter _decoratee
          The interpolating converter used to get the intermediate result.
protected  IObjectMapper _mapper
          The object mapper used to convert the intermediate result to the final result.
 
Constructor Summary
ChainedInterpolatingConverter(IInterpolatingConverter decoratee, IObjectMapper mapper)
           
 
Method Summary
 java.lang.String name()
          Return the name of the converter decorated by this instance.
 java.lang.Object toObject(java.util.ResourceBundle bundle, java.lang.String baseKey, INoReturnMap argMap, KeyLookupRecord context)
          Use the decoratee to convert the bundle key, then pass the result to the object mapper to obtain the final result.
 java.lang.Object toObject(java.lang.String s, java.util.ResourceBundle bundle, INoReturnMap argMap, KeyLookupRecord context)
          Use the decoratee to convert the string, then pass the result to the object mapper to obtain the final result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_decoratee

protected IInterpolatingConverter _decoratee
The interpolating converter used to get the intermediate result.


_mapper

protected IObjectMapper _mapper
The object mapper used to convert the intermediate result to the final result.

Constructor Detail

ChainedInterpolatingConverter

public ChainedInterpolatingConverter(IInterpolatingConverter decoratee,
                                     IObjectMapper mapper)
Method Detail

toObject

public java.lang.Object toObject(java.lang.String s,
                                 java.util.ResourceBundle bundle,
                                 INoReturnMap argMap,
                                 KeyLookupRecord context)
                          throws java.text.ParseException,
                                 java.util.MissingResourceException
Use the decoratee to convert the string, then pass the result to the object mapper to obtain the final result.

Specified by:
toObject in interface IInterpolatingStringToObjectConverter
Throws:
java.text.ParseException
java.util.MissingResourceException

toObject

public java.lang.Object toObject(java.util.ResourceBundle bundle,
                                 java.lang.String baseKey,
                                 INoReturnMap argMap,
                                 KeyLookupRecord context)
                          throws java.text.ParseException,
                                 java.util.MissingResourceException
Use the decoratee to convert the bundle key, then pass the result to the object mapper to obtain the final result.

Specified by:
toObject in interface IInterpolatingResourceBundleToObjectConverter
Throws:
java.text.ParseException
java.util.MissingResourceException

name

public java.lang.String name()
Return the name of the converter decorated by this instance.

Specified by:
name in interface IInterpolatingConverter