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

public class MethodHelper extends Object
  • Method Details Link icon

    • checkParameterLength Link icon

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

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

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

      public static int getInt(Object data)
    • getString Link icon

      public static String getString(Object data)
    • unwrapEntitySequence Link icon

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

      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 Link icon

      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