Package freemarker.template
Interface TemplateDateModel
- All Superinterfaces:
TemplateModel
- All Known Implementing Classes:
SimpleDate
Date values in a template data model must implement this interface.
Contrary to Java, FreeMarker actually distinguishes values that represent
only a time, only a date, or a combined date and time. All three are
represented using this single interface, however there's a method that
-
Nested Class Summary
Nested classes/interfaces inherited from interface freemarker.template.TemplateModel
TemplateModel.InvalidExpressionModel, TemplateModel.JavaNull -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe date model represents a date-only value.static final intThe date model represents a datetime value.static final intThe date model represents a time-only value.static final Liststatic final intIt is not known whether the date model represents a time-only, a date-only, or a datetime value.Fields inherited from interface freemarker.template.TemplateModel
INVALID_EXPRESSION, JAVA_NULL, NOTHING -
Method Summary
Modifier and TypeMethodDescriptionReturns the date value.intReturns the type of the date.
-
Field Details
-
UNKNOWN
static final int UNKNOWNIt is not known whether the date model represents a time-only, a date-only, or a datetime value.- See Also:
-
TIME
static final int TIMEThe date model represents a time-only value.- See Also:
-
DATE
static final int DATEThe date model represents a date-only value.- See Also:
-
DATETIME
static final int DATETIMEThe date model represents a datetime value.- See Also:
-
TYPE_NAMES
-
-
Method Details
-
getAsDate
Returns the date value. The return value must not be null.- Returns:
- the
Dateinstance associated with this date model. - Throws:
TemplateModelException
-
getDateType
int getDateType()Returns the type of the date. It can be any of TIME, DATE, or DATETIME.
-