|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
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()
|
メソッドの概要 | |
Object |
convert(Object source,
Class destClass,
ConversionContext context)
source をdestClass に変換したオブジェクトを返します。 |
Class |
getDestClass()
このコンバータがサポートしている変換先のクラスを返します。 |
Class[] |
getSourceClasses()
このコンバータがサポートしている変換元のクラスを配列で返します。 |
protected Date |
toDate(Calendar calendar)
Calendar をDate に変換して返します。 |
protected Date |
toDate(Number date)
Number をDate に変換して返します。 |
protected Date |
toDate(String date,
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 Class[] getSourceClasses()
Converter
の記述: 最低でも1以上の長さを持つ配列を返します。
public Class getDestClass()
Converter
の記述:
public Object convert(Object source, Class destClass, ConversionContext context)
Converter
の記述: source
をdestClass
に変換したオブジェクトを返します。
source
- 変換元のオブジェクトdestClass
- 変換先のクラスcontext
- 変換コンテキスト
destClass
のインスタンスです。protected Date toDate(Calendar calendar)
Calendar
をDate
に変換して返します。
calendar
- 変換元のCalendar
Date
protected Date toDate(Number date)
Number
をDate
に変換して返します。
date
- 変換元のNumber
Date
protected Date toDate(String date, DateFormat dateFormat)
Date
に変換して返します。
date
- 変換元のオブジェクトの文字列表現dateFormat
- フォーマット
Date
|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |