Package fmpp.tdd

Class TddUtil

java.lang.Object
fmpp.tdd.TddUtil

public class TddUtil extends Object
Utility methods for TDD related tasks.
  • Constructor Details

    • TddUtil

      public TddUtil()
  • Method Details

    • getDataLoaderInstance

      public static DataLoader getDataLoaderInstance(Engine eng, String dlName) throws EvalException
      Resolves a data loader name to a data loader instance.
      Throws:
      EvalException
    • convertToDataMap

      public static Map<?,?> convertToDataMap(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.
      RuntimeException - Any other unexpected exception that occurs during the conversion will be wrapped into some RuntimeException subclass.
      Since:
      0.9.16