|
||||||||||
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.CollectionConverter
public class CollectionConverter
An interpolating converter from resource bundles and strings to collections.
Field Summary | |
---|---|
protected java.util.Map |
_optionMap
The option map used for StringListUtilities.createObjectList() . |
static CollectionConverter |
INSTANCE_COLLECTION_CONVERTER
A converter to collections of instances. |
static CollectionConverter |
INTEGER_COLLECTION_CONVERTER
A converter to collections of integers. |
static CollectionConverter |
STRING_COLLECTION_CONVERTER
A converter to collections of strings. |
Fields inherited from class com.taco.text.InterpolatingConverter |
---|
_BAD_OBJECT_MAPPER, _IGNORE_PROPERTY_VALUE, _IMPORTS, _STATIC_IMPORTS, _TO_OBJECT_MAPPER_CONVERTER, DEFAULT_INSTANCE |
Fields inherited from class com.taco.text.AbstractInterpolatingStringToObjectConverter |
---|
_defArgMap, _defBundle |
Constructor Summary | |
---|---|
CollectionConverter(IInterpolatingStringToObjectConverter converter)
Construct a new instance that uses the argument interpolating string to object converter to convert strings that represents elements into objects. |
|
CollectionConverter(java.util.Map options)
Create a new instance that uses the argument option map when calling StringListUtilities.createObjectList() . |
|
CollectionConverter(java.util.ResourceBundle bundle,
INoReturnMap argMap,
IInterpolatingStringToObjectConverter converter)
Construct a new instance that uses the argument interpolating string to object converter to convert strings that represents elements into objects. |
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. |
protected java.lang.Object |
_toObject(java.util.ResourceBundle bundle,
java.lang.String baseKey,
INoReturnMap argMap,
KeyLookupRecord context,
java.lang.String globalName)
If baseKey is mapped to a string, send it to
toObject(String, ResourceBundle, INoReturnMap, String) . |
java.lang.String |
name()
If the simple class name ends with "Converter" , return the
part before "Converter" . |
Methods inherited from class com.taco.text.InterpolatingConverter |
---|
_argMapReferenceToObject, _getStandardImports, _getStandardStaticImports, _literalResultToObject, _scriptSnippetToObject, _toObjectMapper, clone, 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 java.util.Map _optionMap
StringListUtilities.createObjectList()
.
public static final CollectionConverter STRING_COLLECTION_CONVERTER
QuotedStringConverter
.
public static final CollectionConverter INSTANCE_COLLECTION_CONVERTER
StringToBeanShellInstanceConverter
.
public static final CollectionConverter INTEGER_COLLECTION_CONVERTER
AtomConverter.INTEGER_CONVERTER
.
Constructor Detail |
---|
public CollectionConverter(IInterpolatingStringToObjectConverter converter)
public CollectionConverter(java.util.ResourceBundle bundle, INoReturnMap argMap, IInterpolatingStringToObjectConverter converter)
java.lang.NullPointerException
- if converter
is
null
public CollectionConverter(java.util.Map options)
StringListUtilities.createObjectList()
. Note, the
argument map is not copied, so the caller must ensure it is not
modified afterwards.
Method Detail |
---|
public java.lang.String name()
InterpolatingConverter
"Converter"
, return the
part before "Converter"
. Otherwise, just return the simple
class name.
name
in interface IInterpolatingConverter
name
in class InterpolatingConverter
protected java.lang.Object _toObject(java.util.ResourceBundle bundle, java.lang.String baseKey, INoReturnMap argMap, KeyLookupRecord context, java.lang.String globalName) throws java.text.ParseException, java.util.MissingResourceException
baseKey
is mapped to a string, send it to
toObject(String, ResourceBundle, INoReturnMap, String)
. If
it's mapped to something else, return it immediately. Otherwise, read
the subkeys "0", "1", ... until an error occurs. Put the result of
converting each subkey in the returned collection. If available, use
the collection factory in the option map.
_toObject
in class InterpolatingConverter
java.text.ParseException
java.util.MissingResourceException
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |