Package fmpp.tdd

Class TddUtil


  • public class TddUtil
    extends java.lang.Object
    Utility 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 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TddUtil

        public TddUtil()
    • 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 TypeNotConvertableToMapException
        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. 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).
        Returns:
        A 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.
        Throws:
        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.
        Since:
        0.9.16