クラス ValueTypeRegistry

  • すべての実装されたインタフェース:
    org.springframework.beans.factory.InitializingBean

    public class ValueTypeRegistry
    extends Object
    implements org.springframework.beans.factory.InitializingBean
    ValueType を管理します。
    バージョン:
    0.3
    作成者:
    T.TSUCHIE
    • フィールドの詳細

    • コンストラクタの詳細

      • ValueTypeRegistry

        public ValueTypeRegistry()
    • メソッドの詳細

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception

        初期化処理として、標準の ValueType を登録する(registerWithDefaultValueTypes())。

        定義:
        afterPropertiesSet インタフェース内 org.springframework.beans.factory.InitializingBean
        例外:
        Exception
      • registerWithDefaultValueTypes

        protected void registerWithDefaultValueTypes()
        標準の ValueType を登録する。
      • isRegisteredType

        public boolean isRegisteredType​(@NonNull
                                        @NonNull Class<?> classType)
        登録済みのクラスタイプかどうか判定します。
        パラメータ:
        classType - 判定対象のクラスタイプ。
        戻り値:
        登録済みのクラスタイプのとき true を返します。
      • findValueType

        public ValueType<?> findValueType​(@NonNull
                                          @NonNull Class<?> classType)
        登録済みのクラスタイプ対する ValueType を取得します。
        パラメータ:
        classType - クラスタイプ。
        戻り値:
        ValueType を返します。ただし、登録済みでない場合は、null を返します。
      • findValueType

        public ValueType<?> findValueType​(@NonNull
                                          @NonNull PropertyMeta propertyMeta)
        エンティティのプロパティメタ情報に対する ValueType を取得します。
        パラメータ:
        propertyMeta - プロパティメタ情報
        戻り値:
        対応する ValueTypeの実装を返します。
        例外:
        ValueTypeNotFoundException - 対応する ValueType が見つからない場合。
      • getValueType

        protected ValueType<?> getValueType​(PropertyMeta propertyMeta,
                                            Convert convertAnno)
        アノテーション Convert から ValueType を取得する。
        パラメータ:
        propertyMeta - 対象となるプロパティメタ情報
        convertAnno - 変換規則を指定するアノテーション
        戻り値:
        ValueTypeのインスタンス。
      • getLobType

        protected ValueType<?> getLobType​(PropertyMeta propertyMeta)
        ラージオブジェクト用のValueType を取得する。
        パラメータ:
        propertyMeta - 対象となるプロパティメタ情報
        戻り値:
        ValueTypeのインスタンス。
      • getEnumType

        protected ValueType<?> getEnumType​(PropertyMeta propertyMeta)
        列挙型用のValueType を取得する。
        パラメータ:
        propertyMeta - 対象となるプロパティメタ情報
        戻り値:
        ValueTypeのインスタンス。
      • getUtilDateType

        protected ValueType<?> getUtilDateType​(PropertyMeta propertyMeta)
        時制の型が不明な Date の ValueType} を取得する。
        パラメータ:
        propertyMeta - 対象となるプロパティメタ情報
        戻り値:
        ValueTypeのインスタンス。
      • register

        public <T> void register​(@NonNull
                                 @NonNull Class<T> type,
                                 @NonNull
                                 @NonNull ValueType<T> valueType)
        ValueType を登録します。
        型パラメータ:
        T - 関連付ける型
        パラメータ:
        type - 関連付けるクラスタイプ
        valueType - ValueTypeの実装
      • getApplicationContext

        public org.springframework.context.ApplicationContext getApplicationContext()
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
      • getMessageFormatter

        public com.github.mygreen.messageformatter.MessageFormatter getMessageFormatter()
      • setMessageFormatter

        public void setMessageFormatter​(com.github.mygreen.messageformatter.MessageFormatter messageFormatter)
      • getLobHandler

        public org.springframework.jdbc.support.lob.LobHandler getLobHandler()
      • setLobHandler

        public void setLobHandler​(org.springframework.jdbc.support.lob.LobHandler lobHandler)