Class MethodHelper
java.lang.Object
ch.tocco.nice2.templating.api.freemarker.methods.MethodHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkParameterLength
(List params, int requiredSize) static void
checkParameterLength
(List params, int minLenght, int maxLength) static Entity
static int
static List
<PrimaryKey> getKeysFromArgument
(Object listModel) loads the primary keys of a sequence of entitiesstatic EntityModel
getModelFromArgument
(Object listModel) loads the entity model of a sequence of entitiesstatic String
unwrapEntitySequence
(Object sequence)
-
Method Details
-
checkParameterLength
-
checkParameterLength
-
getEntity
- Throws:
freemarker.template.TemplateModelException
-
getInt
-
getString
-
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
-