Class DateLayout

  • All Implemented Interfaces:
    OptionHandler
    Direct Known Subclasses:
    TTCCLayout

    public abstract class DateLayout
    extends Layout
    This abstract layout takes care of all the date related options and formatting work.
    Author:
    Ceki Gülcü
    • Field Detail

      • NULL_DATE_FORMAT

        public static final String NULL_DATE_FORMAT
        String constant designating no time information. Current value of this constant is NULL.
        See Also:
        Constant Field Values
      • RELATIVE_TIME_DATE_FORMAT

        public static final String RELATIVE_TIME_DATE_FORMAT
        String constant designating relative time. Current value of this constant is RELATIVE.
        See Also:
        Constant Field Values
      • DATE_FORMAT_OPTION

        public static final String DATE_FORMAT_OPTION
        Deprecated.
        Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.
        See Also:
        Constant Field Values
      • TIMEZONE_OPTION

        public static final String TIMEZONE_OPTION
        Deprecated.
        Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.
        See Also:
        Constant Field Values
      • date

        protected Date date
    • Constructor Detail

      • DateLayout

        public DateLayout()
    • Method Detail

      • getOptionStrings

        public String[] getOptionStrings()
        Deprecated.
        Use the setter method for the option directly instead of the generic setOption method.
      • setOption

        public void setOption​(String option,
                              String value)
        Deprecated.
        Use the setter method for the option directly instead of the generic setOption method.
      • setDateFormat

        public void setDateFormat​(String dateFormat)
        The value of the DateFormat option should be either an argument to the constructor of SimpleDateFormat or one of the srings "NULL", "RELATIVE", "ABSOLUTE", "DATE" or "ISO8601.
      • getDateFormat

        public String getDateFormat()
        Returns value of the DateFormat option.
      • getTimeZone

        public String getTimeZone()
        Returns value of the TimeZone option.
      • activateOptions

        public void activateOptions()
        Description copied from interface: OptionHandler
        Activate the options that were previously set with calls to option setters.

        This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set.

        For example, the FileAppender has the File and Append options both of which are ambigous until the other is also set.

      • setDateFormat

        public void setDateFormat​(DateFormat dateFormat,
                                  TimeZone timeZone)
        Sets the DateFormat used to format time and date in the zone determined by timeZone.