freemarker.template
Interface TemplateDateModel
- TemplateModel
- DateModel, SimpleDate
public interface TemplateDateModel
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
$Id: TemplateDateModel.java,v 1.10 2004/03/13 13:05:09 ddekany Exp $static int | DATE - The date model represents a date-only value.
|
static int | DATETIME - The date model represents a datetime value.
|
static int | TIME - The date model represents a time-only value.
|
static List | TYPE_NAMES
|
static int | UNKNOWN - It is not known whether the date model represents a time-only,
a date-only, or a datetime value.
|
DATE
public static final int DATE
The date model represents a date-only value.
DATETIME
public static final int DATETIME
The date model represents a datetime value.
TIME
public static final int TIME
The date model represents a time-only value.
TYPE_NAMES
public static final List TYPE_NAMES
UNKNOWN
public static final int UNKNOWN
It is not known whether the date model represents a time-only,
a date-only, or a datetime value.
getAsDate
public Date getAsDate()
throws TemplateModelException
Returns the date value. The return value must not be null.
- the
Date
instance associated with this date model.
getDateType
public int getDateType()
Returns the type of the date. It can be any of TIME,
DATE, or DATETIME.