public class TddUtil
extends java.lang.Object
Constructor and Description |
---|
TddUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<?,?> |
convertToDataMap(java.lang.Object value)
Converts a value to
Map , if it's possible, in a way that mostly useful when it will be used as part of
the "data" setting. |
static DataLoader |
getDataLoaderInstance(Engine eng,
java.lang.String dlName)
Resolves a data loader name to a data loader instance.
|
public static DataLoader getDataLoaderInstance(Engine eng, java.lang.String dlName) throws EvalException
EvalException
public static java.util.Map<?,?> convertToDataMap(java.lang.Object value) throws TypeNotConvertableToMapException
Map
, if it's possible, in a way that mostly useful when it will be used as part of
the "data" setting. Returns Map
-s and null
as is. At the moment it can convert
TemplateHashModelEx
and the appropriate AdapterTemplateModel
objects. It will convert
TemplateModel
keys of the key-value pairs to String
-s, but keep TemplateModel
values of
the key-value pairs as is, so that they keep any extra FreeMarker-specific functionality (like the
TemplateNodeModel
interface).Map
that's normally a Map<String, Object>
, but this method don't guarantee that due to
backward compatibility restrictions. null
exactly if the argument was null
.TypeNotConvertableToMapException
- If the type is not convertible to Map
.java.lang.RuntimeException
- Any other unexpected exception that occurs during the conversion will be wrapped into some
RuntimeException
subclass.