Class MethodHelper
java.lang.Object
ch.tocco.nice2.templating.api.freemarker.methods.MethodHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckParameterLength(List params, int requiredSize) static voidcheckParameterLength(List params, int minLenght, int maxLength) static Entitystatic intstatic List<PrimaryKey> getKeysFromArgument(Object listModel) loads the primary keys of a sequence of entitiesstatic EntityModelgetModelFromArgument(Object listModel) loads the entity model of a sequence of entitiesstatic StringunwrapEntitySequence(Object sequence)
-
Method Details
-
checkParameterLength
-
checkParameterLength
-
getEntity
-
getInt
-
getString
-
unwrapEntitySequence
-
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
-