org.seasar.extension.dxo.converter.impl
クラス SqlTimestampConverter

java.lang.Object
  拡張org.seasar.extension.dxo.converter.impl.AbstractConverter
      拡張org.seasar.extension.dxo.converter.impl.SqlTimestampConverter
すべての実装インタフェース:
Converter

public class SqlTimestampConverter
extends AbstractConverter

任意のオブジェクトからTimestampへの変換を行うコンバータです。

変換は次のように行われます。

作成者:
Satoshi Kimura, koichik

フィールドの概要
 
クラス org.seasar.extension.dxo.converter.impl.AbstractConverter から継承したフィールド
shallowCopy
 
コンストラクタの概要
SqlTimestampConverter()
           
 
メソッドの概要
 java.lang.Object convert(java.lang.Object source, java.lang.Class destClass, ConversionContext context)
          sourcedestClassに変換したオブジェクトを返します。
 java.lang.Class getDestClass()
          このコンバータがサポートしている変換先のクラスを返します。
 java.lang.Class[] getSourceClasses()
          このコンバータがサポートしている変換元のクラスを配列で返します。
protected  java.sql.Timestamp toTimestamp(java.util.Calendar calendar)
          CalendarTimestampに変換して返します。
protected  java.sql.Timestamp toTimestamp(java.util.Date date)
          DateTimestampに変換して返します。
protected  java.sql.Timestamp toTimestamp(java.lang.Number date)
          NumberTimestampに変換して返します。
protected  java.sql.Timestamp toTimestamp(java.lang.String date, java.text.DateFormat dateFormat)
          文字列をTimestampに変換して返します。
 
クラス 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
 

コンストラクタの詳細

SqlTimestampConverter

public SqlTimestampConverter()
メソッドの詳細

getSourceClasses

public java.lang.Class[] getSourceClasses()
インタフェース Converter の記述:
このコンバータがサポートしている変換元のクラスを配列で返します。

最低でも1以上の長さを持つ配列を返します。

戻り値:
このコンバータがサポートしている変換元のクラスの配列

getDestClass

public java.lang.Class getDestClass()
インタフェース Converter の記述:
このコンバータがサポートしている変換先のクラスを返します。

戻り値:
このコンバータがサポートしている変換先のクラス

convert

public java.lang.Object convert(java.lang.Object source,
                                java.lang.Class destClass,
                                ConversionContext context)
インタフェース Converter の記述:
sourcedestClassに変換したオブジェクトを返します。

パラメータ:
source - 変換元のオブジェクト
destClass - 変換先のクラス
context - 変換コンテキスト
戻り値:
変換先のオブジェクト。これはdestClassのインスタンスです。

toTimestamp

protected java.sql.Timestamp toTimestamp(java.util.Date date)
DateTimestampに変換して返します。

パラメータ:
date - 変換元のDate
戻り値:
変換した結果のTimestamp

toTimestamp

protected java.sql.Timestamp toTimestamp(java.util.Calendar calendar)
CalendarTimestampに変換して返します。

パラメータ:
calendar - 変換元のCalendar
戻り値:
変換した結果のTimestamp

toTimestamp

protected java.sql.Timestamp toTimestamp(java.lang.Number date)
NumberTimestampに変換して返します。

パラメータ:
date - 変換元のNumber
戻り値:
変換した結果のTimestamp

toTimestamp

protected java.sql.Timestamp toTimestamp(java.lang.String date,
                                         java.text.DateFormat dateFormat)
文字列をTimestampに変換して返します。

パラメータ:
date - 変換元のオブジェクトの文字列表現
dateFormat - フォーマット
戻り値:
変換した結果のTimestamp


Copyright © 2004-2014 The Seasar Foundation. All Rights Reserved.