Package fmpp.tdd
Class TddUtil
java.lang.Object
fmpp.tdd.TddUtil
Utility methods for TDD related tasks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Map
<?, ?> convertToDataMap
(Object value) Converts a value toMap
, 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, String dlName) Resolves a data loader name to a data loader instance.
-
Constructor Details
-
TddUtil
public TddUtil()
-
-
Method Details
-
getDataLoaderInstance
Resolves a data loader name to a data loader instance.- Throws:
EvalException
-
convertToDataMap
Converts a value toMap
, if it's possible, in a way that mostly useful when it will be used as part of the "data" setting. ReturnsMap
-s andnull
as is. At the moment it can convertTemplateHashModelEx
and the appropriateAdapterTemplateModel
objects. It will convertTemplateModel
keys of the key-value pairs toString
-s, but keepTemplateModel
values of the key-value pairs as is, so that they keep any extra FreeMarker-specific functionality (like theTemplateNodeModel
interface).- Returns:
- A
Map
that's normally aMap<String, Object>
, but this method don't guarantee that due to backward compatibility restrictions.null
exactly if the argument wasnull
. - Throws:
TypeNotConvertableToMapException
- If the type is not convertible toMap
.RuntimeException
- Any other unexpected exception that occurs during the conversion will be wrapped into someRuntimeException
subclass.- Since:
- 0.9.16
-