org.seasar.framework.beans.util
クラス AbstractCopy<S extends AbstractCopy<S>>

java.lang.Object
  上位を拡張 org.seasar.framework.beans.util.AbstractCopy<S>
型パラメータ:
S - JavaBeansに対して操作を行うサブタイプです。
直系の既知のサブクラス:
Copy, CreateAndCopy

public abstract class AbstractCopy<S extends AbstractCopy<S>>
extends Object

JavaBeansやMapに対して操作を行う抽象クラスです。

作成者:
higa

フィールドの概要
protected  char beanDelimiter
          JavaBeanのデリミタです。
protected  Map<String,Converter> converterMap
          特定のプロパティに関連付けられたコンバータです。
protected  List<Converter> converters
          特定のプロパティに関連付けられていないコンバータです。
protected static String[] EMPTY_STRING_ARRAY
          空の文字列の配列です。
protected  String[] excludePropertyNames
          操作の対象に含めないプロパティ名の配列です。
protected  boolean excludesNull
          null値のプロパティを操作の対象外にするかどうかです。
protected  String[] includePropertyNames
          操作の対象に含めるプロパティ名の配列です。
protected  char mapDelimiter
          Mapのデリミタです。
protected  String prefix
          プレフィックスです。
 
コンストラクタの概要
AbstractCopy()
           
 
メソッドの概要
 S beanDelimiter(char beanDelimiter)
          JavaBeansのデリミタを設定します。
 S converter(Converter converter, String... propertyNames)
          コンバータを設定します。
protected  Object convertValue(Object value, String destPropertyName, Class<?> destPropertyClass)
          値を変換します。
protected  void copyBeanToBean(Object src, Object dest)
          BeanからBeanにコピーを行います。
protected  void copyBeanToMap(Object src, Map dest)
          BeanからMapにコピーを行います。
protected  void copyMapToBean(Map<String,Object> src, Object dest)
          MapからBeanにコピーを行います。
protected  void copyMapToMap(Map<String,Object> src, Map<String,Object> dest)
          MapからMapにコピーを行います。
 S dateConverter(String pattern, String... propertyNames)
          日付のコンバータを設定します。
 S excludes(String... propertyNames)
          操作の対象に含めないプロパティ名を指定します。
 S excludesNull()
          null値のプロパティを操作の対象外にします。
 S includes(String... propertyNames)
          操作の対象に含めるプロパティ名を指定します。
protected  boolean isTargetProperty(String name)
          対象のプロパティかどうかを返します。
 S mapDelimiter(char mapDelimiter)
          Mapのデリミタを設定します。
 S numberConverter(String pattern, String... propertyNames)
          数値のコンバータを設定します。
 S prefix(String prefix)
          プレフィックスを指定します。
protected  String trimPrefix(String propertyName)
          プレフィックスを削ります。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

EMPTY_STRING_ARRAY

protected static final String[] EMPTY_STRING_ARRAY
空の文字列の配列です。


includePropertyNames

protected String[] includePropertyNames
操作の対象に含めるプロパティ名の配列です。


excludePropertyNames

protected String[] excludePropertyNames
操作の対象に含めないプロパティ名の配列です。


excludesNull

protected boolean excludesNull
null値のプロパティを操作の対象外にするかどうかです。


prefix

protected String prefix
プレフィックスです。


beanDelimiter

protected char beanDelimiter
JavaBeanのデリミタです。


mapDelimiter

protected char mapDelimiter
Mapのデリミタです。


converterMap

protected Map<String,Converter> converterMap
特定のプロパティに関連付けられたコンバータです。


converters

protected List<Converter> converters
特定のプロパティに関連付けられていないコンバータです。

コンストラクタの詳細

AbstractCopy

public AbstractCopy()
メソッドの詳細

includes

public S includes(String... propertyNames)
操作の対象に含めるプロパティ名を指定します。

パラメータ:
propertyNames - プロパティ名の配列
戻り値:
このインスタンス自身

excludes

public S excludes(String... propertyNames)
操作の対象に含めないプロパティ名を指定します。

パラメータ:
propertyNames - プロパティ名の配列
戻り値:
このインスタンス自身

excludesNull

public S excludesNull()
null値のプロパティを操作の対象外にします。

パラメータ:
propertyNames - プロパティ名の配列
戻り値:
このインスタンス自身

prefix

public S prefix(String prefix)
プレフィックスを指定します。

パラメータ:
prefix - プレフィックス
戻り値:
このインスタンス自身

beanDelimiter

public S beanDelimiter(char beanDelimiter)
JavaBeansのデリミタを設定します。

パラメータ:
beanDelimiter - JavaBeansのデリミタ
戻り値:
このインスタンス自身

mapDelimiter

public S mapDelimiter(char mapDelimiter)
Mapのデリミタを設定します。

パラメータ:
mapDelimiter - Mapのデリミタ
戻り値:
このインスタンス自身

converter

public S converter(Converter converter,
                   String... propertyNames)
コンバータを設定します。

パラメータ:
converter -
propertyNames -
戻り値:
このインスタンス自身

dateConverter

public S dateConverter(String pattern,
                       String... propertyNames)
日付のコンバータを設定します。

パラメータ:
pattern - 日付のパターン
propertyNames - プロパティ名の配列
戻り値:
このインスタンス自身

numberConverter

public S numberConverter(String pattern,
                         String... propertyNames)
数値のコンバータを設定します。

パラメータ:
pattern - 数値のパターン
propertyNames - プロパティ名の配列
戻り値:
このインスタンス自身

isTargetProperty

protected boolean isTargetProperty(String name)
対象のプロパティかどうかを返します。

パラメータ:
name - プロパティ名
戻り値:
対象のプロパティかどうか

copyBeanToBean

protected void copyBeanToBean(Object src,
                              Object dest)
BeanからBeanにコピーを行います。

パラメータ:
src - コピー元
dest - コピー先

copyBeanToMap

protected void copyBeanToMap(Object src,
                             Map dest)
BeanからMapにコピーを行います。

パラメータ:
src - コピー元
dest - コピー先

copyMapToBean

protected void copyMapToBean(Map<String,Object> src,
                             Object dest)
MapからBeanにコピーを行います。

パラメータ:
src - コピー元
dest - コピー先

copyMapToMap

protected void copyMapToMap(Map<String,Object> src,
                            Map<String,Object> dest)
MapからMapにコピーを行います。

パラメータ:
src - コピー元
dest - コピー先

trimPrefix

protected String trimPrefix(String propertyName)
プレフィックスを削ります。

パラメータ:
propertyName - プロパティ名
戻り値:
削った結果

convertValue

protected Object convertValue(Object value,
                              String destPropertyName,
                              Class<?> destPropertyClass)
値を変換します。

パラメータ:
value - 値
destPropertyName - コピー先のプロパティ名
destPropertyClass - コピー先のプロパティクラス
戻り値:
変換後の値


Copyright ? 2004-2008 The Seasar Foundation. All Rights Reserved.