|
||||||||||
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.InstanceConverter
public class InstanceConverter
A converter to instances via class names or scripts.
Field Summary | |
---|---|
protected java.util.Map |
_extraEnvironment
A map from names of extra variable names to their values. |
protected java.util.Collection |
_extraImports
The additional imports to add to the BeanShell interpreter when evaluating scripts. |
protected java.util.Collection |
_extraStaticImports
The additional static imports to add to the BeanShell interpreter when evaluating scripts. |
static InstanceConverter |
DEFAULT_INSTANCE
The default instance of this class, which does not put any additional variables in the global environment or import any additional classes. |
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 |
InstanceConverter()
Create a new instance that does not add any additional variables or imports to the BeanShell interpreter when evaluating scripts. |
|
InstanceConverter(java.util.Map extraEnvironment,
java.util.Collection extraImports,
java.util.Collection extraStaticImports)
Create a new instance that adds the variable mappings in extraEnvironmentMap and the imports in
extraImports to the BeanShell interpreter when evaluating
scripts. |
Method Summary | |
---|---|
protected java.lang.Object |
_literalToObject(java.lang.String s,
java.util.ResourceBundle bundle,
INoReturnMap argMap,
java.lang.String globalName)
If the trimmed version of s starts with '{' and ends with
'}', treat the string as a script, and return the result of executing the
script. |
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 java.util.Map _extraEnvironment
null
, no extra variable mappings will be
added.
protected java.util.Collection _extraImports
null
, no extra imports will be
added.
protected java.util.Collection _extraStaticImports
null
, no extra static imports will
be added.
public static final InstanceConverter DEFAULT_INSTANCE
Constructor Detail |
---|
protected InstanceConverter()
public InstanceConverter(java.util.Map extraEnvironment, java.util.Collection extraImports, java.util.Collection extraStaticImports)
extraEnvironmentMap
and the imports in
extraImports
to the BeanShell interpreter when evaluating
scripts. Either parameter may be null
. None of the
parameters are copied so the caller must be careful not to modify them
afterwards.
Method Detail |
---|
public static void main(java.lang.String[] args)
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
s
starts with '{' and ends with
'}', treat the string as a script, and return the result of executing the
script. The script has the environment and imports as in
_scriptSnippetToObject
.
_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 |