Package freemarker.core
Class TemplateFormatUtil
java.lang.Object
freemarker.core.TemplateFormatUtil
Utility classes for implementing
TemplateValueFormat-s.- Since:
- 2.3.24
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckHasNoParameters(String params)static DategetNonNullDate(TemplateDateModel dateModel)Utility method to extract theDatefrom anTemplateDateModel, and throwTemplateModelExceptionwith a standard error message if that'snull.static NumbergetNonNullNumber(TemplateNumberModel numberModel)Utility method to extract theNumberfrom anTemplateNumberModel, and throwsTemplateModelExceptionwith a standard error message if that'snull.
-
Method Details
-
checkHasNoParameters
- Throws:
InvalidFormatParametersException
-
getNonNullNumber
public static Number getNonNullNumber(TemplateNumberModel numberModel) throws TemplateModelException, UnformattableValueExceptionUtility method to extract theNumberfrom anTemplateNumberModel, and throwsTemplateModelExceptionwith a standard error message if that'snull.TemplateNumberModelthat storenullare in principle not allowed, and so are considered to be bugs in theObjectWrapperorTemplateNumberModelimplementation. -
getNonNullDate
Utility method to extract theDatefrom anTemplateDateModel, and throwTemplateModelExceptionwith a standard error message if that'snull.TemplateDateModelthat storenullare in principle not allowed, and so are considered to be bugs in theObjectWrapperorTemplateNumberModelimplementation.- Throws:
TemplateModelException
-