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 DataLoadergetDataLoaderInstance(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 andnullas is. At the moment it can convertTemplateHashModelExand the appropriateAdapterTemplateModelobjects. It will convertTemplateModelkeys of the key-value pairs toString-s, but keepTemplateModelvalues of the key-value pairs as is, so that they keep any extra FreeMarker-specific functionality (like theTemplateNodeModelinterface).- Returns:
- A
Mapthat's normally aMap<String, Object>, but this method don't guarantee that due to backward compatibility restrictions.nullexactly 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 someRuntimeExceptionsubclass.- Since:
- 0.9.16
-