java.lang.Object
ch.tocco.nice2.templating.api.freemarker.methods.MethodHelper

public class MethodHelper extends Object
  • Method Details

    • checkParameterLength

      public static void checkParameterLength(List params, int requiredSize)
    • checkParameterLength

      public static void checkParameterLength(List params, int minLenght, int maxLength)
    • getEntity

      public static Entity getEntity(Object data) throws freemarker.template.TemplateModelException
      Throws:
      freemarker.template.TemplateModelException
    • getInt

      public static int getInt(Object data)
    • getString

      public static String getString(Object data)
    • unwrapEntitySequence

      public static List<Entity> unwrapEntitySequence(Object sequence) throws freemarker.template.TemplateModelException
      Throws:
      freemarker.template.TemplateModelException
    • getKeysFromArgument

      public static List<PrimaryKey> getKeysFromArgument(Object listModel) throws freemarker.template.TemplateModelException
      loads the primary keys of a sequence of entities
      Parameters:
      listModel - the sequence model (either a EntityListSequenceModel or a sequence of EnityHashModel)
      Returns:
      a list of primary keys
      Throws:
      freemarker.template.TemplateModelException
    • getModelFromArgument

      public static EntityModel getModelFromArgument(Object listModel) throws freemarker.template.TemplateModelException
      loads the entity model of a sequence of entities
      Parameters:
      listModel - the sequence model (either a EntityListSequenceModel or a sequence of EnityHashModel)
      Returns:
      a list of primary keys
      Throws:
      freemarker.template.TemplateModelException