Package freemarker.core
Class TemplateFormatUtil
- java.lang.Object
-
- freemarker.core.TemplateFormatUtil
-
public final class TemplateFormatUtil extends java.lang.Object
Utility classes for implementingTemplateValueFormat
-s.- Since:
- 2.3.24
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkHasNoParameters(java.lang.String params)
static java.util.Date
getNonNullDate(TemplateDateModel dateModel)
Utility method to extract theDate
from anTemplateDateModel
, and throwTemplateModelException
with a standard error message if that'snull
.static java.lang.Number
getNonNullNumber(TemplateNumberModel numberModel)
Utility method to extract theNumber
from anTemplateNumberModel
, and throwsTemplateModelException
with 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 theNumber
from anTemplateNumberModel
, and throwsTemplateModelException
with a standard error message if that'snull
.TemplateNumberModel
that storenull
are in principle not allowed, and so are considered to be bugs in theObjectWrapper
orTemplateNumberModel
implementation.
-
getNonNullDate
public static java.util.Date getNonNullDate(TemplateDateModel dateModel) throws TemplateModelException
Utility method to extract theDate
from anTemplateDateModel
, and throwTemplateModelException
with a standard error message if that'snull
.TemplateDateModel
that storenull
are in principle not allowed, and so are considered to be bugs in theObjectWrapper
orTemplateNumberModel
implementation.- Throws:
TemplateModelException
-
-