DateLayout Class Reference

Inheritance diagram for DateLayout:

Inheritance graph
[legend]
Collaboration diagram for DateLayout:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void activateOptions ()
virtual void setOption (const String &option, const String &value)
void setDateFormat (const String &dateFormat)
const String & getDateFormat () const
void setTimeZone (const String &timeZone)
const String & getTimeZone () const

Static Public Attributes

String NULL_DATE_FORMAT = _T("NULL")
String RELATIVE_TIME_DATE_FORMAT = _T("RELATIVE")

Protected Member Functions

void setDateFormat (const String &dateFormatType, const TimeZonePtr &timeZone)

Detailed Description

This abstract layout takes care of all the date related options and formatting work.


Member Function Documentation

void activateOptions  )  [virtual]
 

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.

Implements OptionHandler.

const String& getDateFormat  )  const [inline]
 

Returns value of the DateFormat option.

const String& getTimeZone  )  const [inline]
 

Returns value of the TimeZone option.

void setDateFormat const String &  dateFormatType,
const TimeZonePtr timeZone
[protected]
 

Sets the DateFormat used to format date and time in the time zone determined by timeZone parameter. The helpers::DateFormat DateFormat used will depend on the dateFormatType.

The recognized types are NULL_DATE_FORMAT, RELATIVE_TIME_DATE_FORMAT, helpers::AbsoluteTimeDateFormat::ABS_TIME_DATE_FORMAT, helpers::AbsoluteTimeDateFormat::DATE_AND_TIME_DATE_FORMAT and helpers::AbsoluteTimeDateFormat::ISO8601_DATE_FORMAT. If the dateFormatType is not one of the above, then the argument is assumed to be a date pattern for helpers::DateFormat.

void setDateFormat const String &  dateFormat  )  [inline]
 

The value of the DateFormat option should be either an argument to the constructor of helpers::DateFormat or one of the srings "NULL", "RELATIVE", "ABSOLUTE", "DATE" or "ISO8601.

void setOption const String &  option,
const String &  value
[virtual]
 

Set option to value.

The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when activateOptions is called.

Implements OptionHandler.

void setTimeZone const String &  timeZone  )  [inline]
 

The TimeZoneID option is a time zone ID string in the format expected by the locale C++ standard class.


Member Data Documentation

String NULL_DATE_FORMAT = _T("NULL") [static]
 

String constant designating no time information. Current value of this constant is NULL.

String RELATIVE_TIME_DATE_FORMAT = _T("RELATIVE") [static]
 

String constant designating relative time. Current value of this constant is RELATIVE.


The documentation for this class was generated from the following files:
  • datelayout.h
  • datelayout.cpp

Copyright © 1999-2004, Apache Software Foundation