|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object
|
+--org.apache.log4j.Layout
|
+--org.apache.log4j.helpers.DateLayout
This abstract layout takes care of all the date related options and formatting work.
この抽象レイアウトクラスは、全ての日付関連のオプションとフォーマット作業のお世話をします。
| フィールドの概要 | |
protected Date |
date
|
static String |
DATE_FORMAT_OPTION
推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term. 今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、今後必要なくなり、そして、近いうちに削除されるでしょう。 |
protected DateFormat |
dateFormat
|
static String |
NULL_DATE_FORMAT
String constant designating no time information. |
protected FieldPosition |
pos
|
static String |
RELATIVE_TIME_DATE_FORMAT
String constant designating relative time. |
static String |
TIMEZONE_OPTION
推奨されていません。 Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term. 今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、今後必要なくなり、そして、近いうちに削除されるでしょう。 |
| クラス org.apache.log4j.Layout から継承したフィールド |
LINE_SEP, LINE_SEP_LEN |
| コンストラクタの概要 | |
DateLayout()
|
|
| メソッドの概要 | |
void |
activateOptions()
Activate the options that were previously set with calls to option setters. |
void |
dateFormat(StringBuffer buf,
LoggingEvent event)
|
String |
getDateFormat()
Returns value of the DateFormat option. |
String[] |
getOptionStrings()
Return list of strings that the OptionHandler instance recognizes. |
String |
getTimeZone()
Returns value of the TimeZone option. |
void |
setDateFormat(DateFormat dateFormat,
TimeZone timeZone)
Sets the DateFormat used to format time and date in the
zone determined by timeZone.
|
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.
|
void |
setDateFormat(String dateFormatType,
TimeZone timeZone)
Sets the DateFormat used to format date and time in the time zone determined by timeZone parameter. |
void |
setOption(String option,
String value)
Set option to value.
|
void |
setTimeZone(String timeZone)
The TimeZoneID option is a time zone ID string in the format expected by the TimeZone.getTimeZone(java.lang.String) method.
|
| クラス org.apache.log4j.Layout から継承したメソッド |
format, getContentType, getFooter, getHeader, ignoresThrowable |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
public static final String NULL_DATE_FORMAT
時間情報を指定しない時に使用する文字列定数です。 この定数の現在の値は、NULL です。
public static final String RELATIVE_TIME_DATE_FORMAT
時間を関連づけるよう指定するための文字列定数です。 この定数の現在の値は、RELATIVEです。
protected FieldPosition pos
public static final String DATE_FORMAT_OPTION
今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、今後必要なくなり、そして、近いうちに削除されるでしょう。
public static final String TIMEZONE_OPTION
今日、オプションは、JavaBeansパラダイムを使用して処理されます。 この定数は、今後必要なくなり、そして、近いうちに削除されるでしょう。
protected DateFormat dateFormat
protected Date date
| コンストラクタの詳細 |
public DateLayout()
| メソッドの詳細 |
public String[] getOptionStrings()
setOption method.
一般的なsetOptionメソッドの代わりに直接オプションのためのセッタメソッドを使用します。
OptionHandler の記述: OptionHandlerインスタンスが認識する文字列のリストを返します。
public void setOption(String option,
String value)
setOption method.
一般的なsetOptionメソッドの代わりに直接オプションのためのセッタメソッドを使用します。
OptionHandler の記述: 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 OptionHandler.activateOptions() is
called.
各オプションの処理は、OptionHandlerのインスタンスに依存します。
いくつかのオプションは、直ぐに有効になりますが、その他は OptionHandler.activateOptions()が呼ばれる時にだけ有効になります。
public void setDateFormat(String dateFormat)
SimpleDateFormat or one of
the srings "NULL", "RELATIVE", "ABSOLUTE", "DATE" or "ISO8601.
DateFormatオプションの値は、SimpleDateFormatのコンストラクタの引数か、文字列 "NULL"、"RELATIVE"、"ABSOLUTE"、"DATE"または"ISO8601"のうちのひとつになります。
public String getDateFormat()
DateFormatオプションの値を返します。
public void setTimeZone(String timeZone)
TimeZone.getTimeZone(java.lang.String) method.
TimeZoneID オプションは、TimeZone.getTimeZone(java.lang.String) メソッドで求められるフォーマットを使ったタイムゾーンID文字列です。
public String getTimeZone()
TimeZone オプションの値を返します。
public void activateOptions()
OptionHandler の記述: オプションセッタを使い、前もって設定されていたオプションをアクティブにします。
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.
例えば、FileAppenderは、File と Append の2つのオプションを持っていますが、その他のオプションもセットされるまで曖昧です。
public void dateFormat(StringBuffer buf,
LoggingEvent event)
public void setDateFormat(DateFormat dateFormat,
TimeZone timeZone)
DateFormat used to format time and date in the
zone determined by timeZone.
timeZoneにより決定されるゾーンでの時間と日付をフォーマットする際に使われる DateFormat を設定します。
public void setDateFormat(String dateFormatType,
TimeZone timeZone)
timeZone parameter. The DateFormat used
will depend on the dateFormatType.
timeZone パラメタにより決定されるゾーンでの日付と時間をフォーマットする際に使われる DateFormat を設定します。
使用される DateFormat は、dateFormatType に依存します。
The recognized types are NULL_DATE_FORMAT, RELATIVE_TIME_DATE_FORMAT AbsoluteTimeDateFormat.ABS_TIME_DATE_FORMAT, AbsoluteTimeDateFormat.DATE_AND_TIME_DATE_FORMAT and AbsoluteTimeDateFormat.ISO8601_DATE_FORMAT. If the
dateFormatType is not one of the above, then the
argument is assumed to be a date pattern for SimpleDateFormat.
認識可能やタイプとして、NULL_DATE_FORMAT、RELATIVE_TIME_DATE_FORMAT、AbsoluteTimeDateFormat.ABS_TIME_DATE_FORMAT、AbsoluteTimeDateFormat.DATE_AND_TIME_DATE_FORMATとAbsoluteTimeDateFormat.ISO8601_DATE_FORMATがあります。
もし、dateFormatTypeが上記のどれにも該当しない場合、引数は、SimpleDateFormatに関する日付パタンと仮定されます。
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||