public final class TemplateFormatUtil
extends java.lang.Object
TemplateValueFormat
-s.Modifier and Type | Method and Description |
---|---|
static void |
checkHasNoParameters(java.lang.String params) |
static java.util.Date |
getNonNullDate(TemplateDateModel dateModel)
Utility method to extract the
Date from an TemplateDateModel , and throw
TemplateModelException with a standard error message if that's null . |
static java.lang.Number |
getNonNullNumber(TemplateNumberModel numberModel)
Utility method to extract the
Number from an TemplateNumberModel , and throws
TemplateModelException with a standard error message if that's null . |
public static void checkHasNoParameters(java.lang.String params) throws InvalidFormatParametersException
InvalidFormatParametersException
public static java.lang.Number getNonNullNumber(TemplateNumberModel numberModel) throws TemplateModelException, UnformattableValueException
Number
from an TemplateNumberModel
, and throws
TemplateModelException
with a standard error message if that's null
. TemplateNumberModel
that store null
are in principle not allowed, and so are considered to be bugs in the
ObjectWrapper
or TemplateNumberModel
implementation.public static java.util.Date getNonNullDate(TemplateDateModel dateModel) throws TemplateModelException
Date
from an TemplateDateModel
, and throw
TemplateModelException
with a standard error message if that's null
. TemplateDateModel
that store null
are in principle not allowed, and so are considered to be bugs in the
ObjectWrapper
or TemplateNumberModel
implementation.TemplateModelException