|
|||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||
java.lang.Objectorg.seasar.extension.dxo.converter.impl.AbstractConverter
org.seasar.extension.dxo.converter.impl.DateConverter
任意のオブジェクトからDateへの変換を行うコンバータです。
変換は次のように行われます。
Dateなら、変換元をそのまま変換先とします。Calendarなら、同じ時刻を持つDateを変換先とします。数なら、そのlong値を時刻とするDateを変換先とします。Dateに変換した結果を変換先とします。
| フィールドの概要 |
| クラス org.seasar.extension.dxo.converter.impl.AbstractConverter から継承したフィールド |
shallowCopy |
| コンストラクタの概要 | |
DateConverter()
|
|
| メソッドの概要 | |
java.lang.Object |
convert(java.lang.Object source,
java.lang.Class destClass,
ConversionContext context)
sourceをdestClassに変換したオブジェクトを返します。 |
java.lang.Class |
getDestClass()
このコンバータがサポートしている変換先のクラスを返します。 |
java.lang.Class[] |
getSourceClasses()
このコンバータがサポートしている変換元のクラスを配列で返します。 |
protected java.util.Date |
toDate(java.util.Calendar calendar)
CalendarをDateに変換して返します。 |
protected java.util.Date |
toDate(java.lang.Number date)
NumberをDateに変換して返します。 |
protected java.util.Date |
toDate(java.lang.String date,
java.text.DateFormat dateFormat)
文字列を Dateに変換して返します。 |
| クラス org.seasar.extension.dxo.converter.impl.AbstractConverter から継承したメソッド |
convert, getEnumName, getEnumOrdinal, isEnum, setShallowCopy |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
public DateConverter()
| メソッドの詳細 |
public java.lang.Class[] getSourceClasses()
Converter の記述: 最低でも1以上の長さを持つ配列を返します。
public java.lang.Class getDestClass()
Converter の記述:
public java.lang.Object convert(java.lang.Object source,
java.lang.Class destClass,
ConversionContext context)
Converter の記述: sourceをdestClassに変換したオブジェクトを返します。
source - 変換元のオブジェクトdestClass - 変換先のクラスcontext - 変換コンテキスト
destClassのインスタンスです。protected java.util.Date toDate(java.util.Calendar calendar)
CalendarをDateに変換して返します。
calendar - 変換元のCalendar
Dateprotected java.util.Date toDate(java.lang.Number date)
NumberをDateに変換して返します。
date - 変換元のNumber
Date
protected java.util.Date toDate(java.lang.String date,
java.text.DateFormat dateFormat)
Dateに変換して返します。
date - 変換元のオブジェクトの文字列表現dateFormat - フォーマット
Date
|
|||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||