Package freemarker.template
Interface TemplateDateModel
- All Superinterfaces:
TemplateModel
- All Known Implementing Classes:
DateModel
,SimpleDate
"date", "time" and "date-time" template language data types: corresponds to
Date
. Contrary to Java,
FreeMarker distinguishes date (no time part), time and date-time values.
Objects of this type should be immutable, that is, calling getAsDate()
and getDateType()
should
always return the same value as for the first time.
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
The date model represents a date value (no time part).static int
The date model represents a date-time value (also known as timestamp).static int
The date model represents a time value (no date part).static List
static int
It is not known whether the date represents a date, a time, or a date-time value.Fields inherited from interface freemarker.template.TemplateModel
NOTHING
-
Method Summary
Modifier and TypeMethodDescriptionReturns the date value.int
Returns the type of the date.
-
Field Details
-
UNKNOWN
static final int UNKNOWNIt is not known whether the date represents a date, a time, or a date-time value. This often leads to exceptions in templates due to ambiguities it causes, so avoid it if possible.- See Also:
- Constant Field Values
-
TIME
static final int TIMEThe date model represents a time value (no date part).- See Also:
- Constant Field Values
-
DATE
static final int DATEThe date model represents a date value (no time part).- See Also:
- Constant Field Values
-
DATETIME
static final int DATETIMEThe date model represents a date-time value (also known as timestamp).- See Also:
- Constant Field Values
-
TYPE_NAMES
-
-
Method Details
-
getAsDate
Returns the date value. The return value must not benull
.- Throws:
TemplateModelException
-
getDateType
int getDateType()
-