Interface TemplateDateModel

All Superinterfaces:
TemplateModel
All Known Implementing Classes:
DateModel, SimpleDate

public interface TemplateDateModel extends TemplateModel
"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

    Fields
    Modifier and Type
    Field
    Description
    static 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 Type
    Method
    Description
    Returns the date value.
    int
    Returns the type of the date.
  • Field Details

    • UNKNOWN

      static final int UNKNOWN
      It 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 TIME
      The date model represents a time value (no date part).
      See Also:
      Constant Field Values
    • DATE

      static final int DATE
      The date model represents a date value (no time part).
      See Also:
      Constant Field Values
    • DATETIME

      static final int DATETIME
      The date model represents a date-time value (also known as timestamp).
      See Also:
      Constant Field Values
    • TYPE_NAMES

      static final List TYPE_NAMES
  • Method Details