Package freemarker.core
Class TemplateFormatUtil
- java.lang.Object
-
- freemarker.core.TemplateFormatUtil
-
public final class TemplateFormatUtil extends java.lang.ObjectUtility classes for implementingTemplateValueFormat-s.- Since:
- 2.3.24
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckHasNoParameters(java.lang.String params)static java.util.DategetNonNullDate(TemplateDateModel dateModel)Utility method to extract theDatefrom anTemplateDateModel, and throwTemplateModelExceptionwith a standard error message if that'snull.static java.lang.NumbergetNonNullNumber(TemplateNumberModel numberModel)Utility method to extract theNumberfrom anTemplateNumberModel, and throwsTemplateModelExceptionwith a standard error message if that'snull.
-
-
-
Method Detail
-
checkHasNoParameters
public static void checkHasNoParameters(java.lang.String params) throws InvalidFormatParametersException- Throws:
InvalidFormatParametersException
-
getNonNullNumber
public static java.lang.Number getNonNullNumber(TemplateNumberModel numberModel) throws TemplateModelException, UnformattableValueException
Utility 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
public static java.util.Date getNonNullDate(TemplateDateModel dateModel) throws TemplateModelException
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
-
-