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

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

public class BooleanConverter
extends AbstractConverter

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

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

作成者:
Satoshi Kimura, koichik

フィールドの概要
protected static String[] TRUES
          trueに評価する文字列の配列です。
protected static BigDecimal ZERO
          0を示す定数です。
 
クラス org.seasar.extension.dxo.converter.impl.AbstractConverter から継承したフィールド
shallowCopy
 
コンストラクタの概要
BooleanConverter()
           
 
メソッドの概要
 Object convert(Object source, Class destClass, ConversionContext context)
          sourcedestClassに変換したオブジェクトを返します。
 Class getDestClass()
          このコンバータがサポートしている変換先のクラスを返します。
 Class[] getSourceClasses()
          このコンバータがサポートしている変換元のクラスを配列で返します。
protected  Object toBoolean(Number value)
          数をBooleanに変換して返します。
protected  Object toBoolean(String value)
          文字列をBooleanに変換して返します。
 
クラス 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
 

フィールドの詳細

TRUES

protected static final String[] TRUES
trueに評価する文字列の配列です。


ZERO

protected static final BigDecimal ZERO
0を示す定数です。

コンストラクタの詳細

BooleanConverter

public BooleanConverter()
メソッドの詳細

getSourceClasses

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

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

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

getDestClass

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

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

convert

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

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

toBoolean

protected Object toBoolean(String value)
文字列をBooleanに変換して返します。

パラメータ:
value - 変換元の文字列表現
戻り値:
変換した結果のBoolean

toBoolean

protected Object toBoolean(Number value)
数をBooleanに変換して返します。

パラメータ:
value - 変換元の数
戻り値:
変換した結果のBoolean


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