|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taco.text.AbstractInterpolatingStringToObjectConverter
com.taco.text.InterpolatingConverter
com.taco.text.MapConverter
public class MapConverter
An interpolating converter to maps.
Field Summary | |
---|---|
protected IInterpolatingStringToObjectConverter |
_keyConverter
The converter for key strings. |
protected IMapFactory |
_mapFactory
The factory used to create the map to return in _literalToObject() . |
protected IInterpolatingStringToObjectConverter |
_valueConverter
The converter for value strings. |
static MapConverter |
DEFAULT_INSTANCE
The default instance of this class which creates an instance of HashMap and uses the default string to object converter
for both keys and values. |
Fields inherited from class com.taco.text.InterpolatingConverter |
---|
_BAD_OBJECT_MAPPER, _IGNORE_PROPERTY_VALUE, _IMPORTS, _STATIC_IMPORTS, _TO_OBJECT_MAPPER_CONVERTER |
Fields inherited from class com.taco.text.AbstractInterpolatingStringToObjectConverter |
---|
_defArgMap, _defBundle |
Constructor Summary | |
---|---|
protected |
MapConverter()
Since an instance with the default parameters is saved in DEFAULT_INSTANCE , this constructor is protected. |
|
MapConverter(IInterpolatingStringToObjectConverter keyConverter,
IInterpolatingStringToObjectConverter valueConverter)
Create an instance that returns a LinkedHashMap when
toObject() is called. |
|
MapConverter(IMapFactory mapFactory,
IInterpolatingStringToObjectConverter keyConverter,
IInterpolatingStringToObjectConverter valueConverter)
Create an instance that uses the argument map factory to create a map when toObject() is called. |
Method Summary | |
---|---|
protected java.lang.Object |
_literalToObject(java.lang.String s,
java.util.ResourceBundle bundle,
INoReturnMap argMap,
java.lang.String globalName)
Given s , which is a string literal, not a reference to
a resource bundle key or a key in the argument map, convert
s to an object. |
static void |
main(java.lang.String[] args)
A simple test program. |
Methods inherited from class com.taco.text.InterpolatingConverter |
---|
_argMapReferenceToObject, _getStandardImports, _getStandardStaticImports, _literalResultToObject, _scriptSnippetToObject, _toObject, _toObjectMapper, clone, name, toObject, toObject, toObject |
Methods inherited from class com.taco.text.AbstractInterpolatingStringToObjectConverter |
---|
toObject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final IInterpolatingStringToObjectConverter _keyConverter
protected final IInterpolatingStringToObjectConverter _valueConverter
protected final IMapFactory _mapFactory
_literalToObject()
.
public static final MapConverter DEFAULT_INSTANCE
HashMap
and uses the default string to object converter
for both keys and values.
Constructor Detail |
---|
protected MapConverter()
DEFAULT_INSTANCE
, this constructor is protected. Create an
instance that returns a LinkedHashMap
when
toObject()
is called. The default instance converter will
be used to convert both keys and values.
public MapConverter(IInterpolatingStringToObjectConverter keyConverter, IInterpolatingStringToObjectConverter valueConverter)
LinkedHashMap
when
toObject()
is called. Convert strings to keys using
keyConverter
and convert strings to values using
valueConverter
.
public MapConverter(IMapFactory mapFactory, IInterpolatingStringToObjectConverter keyConverter, IInterpolatingStringToObjectConverter valueConverter)
toObject()
is called. Convert strings to keys using
keyConverter
and convert strings to values using
valueConverter
.
Method Detail |
---|
protected java.lang.Object _literalToObject(java.lang.String s, java.util.ResourceBundle bundle, INoReturnMap argMap, java.lang.String globalName) throws java.text.ParseException, java.util.MissingResourceException
InterpolatingConverter
Given s
, which is a string literal, not a reference to
a resource bundle key or a key in the argument map, convert
s
to an object.
This implementation simply returns s
unchanged.
_literalToObject
in class InterpolatingConverter
java.text.ParseException
java.util.MissingResourceException
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |