Package fmpp.tdd
Class TddUtil
- java.lang.Object
-
- fmpp.tdd.TddUtil
-
public class TddUtil extends java.lang.ObjectUtility methods for TDD related tasks.
-
-
Constructor Summary
Constructors Constructor Description TddUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<?,?>convertToDataMap(java.lang.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, java.lang.String dlName)Resolves a data loader name to a data loader instance.
-
-
-
Method Detail
-
getDataLoaderInstance
public static DataLoader getDataLoaderInstance(Engine eng, java.lang.String dlName) throws EvalException
Resolves a data loader name to a data loader instance.- Throws:
EvalException
-
convertToDataMap
public static java.util.Map<?,?> convertToDataMap(java.lang.Object value) throws TypeNotConvertableToMapExceptionConverts 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.java.lang.RuntimeException- Any other unexpected exception that occurs during the conversion will be wrapped into someRuntimeExceptionsubclass.- Since:
- 0.9.16
-
-