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 void
checkHasNoParameters(String params)
static Date
getNonNullDate(TemplateDateModel dateModel)
Utility method to extract theDate
from anTemplateDateModel
, and throwTemplateModelException
with a standard error message if that'snull
.static Number
getNonNullNumber(TemplateNumberModel numberModel)
Utility method to extract theNumber
from anTemplateNumberModel
, and throwsTemplateModelException
with 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 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
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
-