クラス ResourceBundleEditor
java.lang.ObjectSE
java.beans.PropertyEditorSupportSE
org.springframework.beans.propertyeditors.ResourceBundleEditor
- 実装されているすべてのインターフェース:
PropertyEditorSE
標準 JDK
ResourceBundlesSE の PropertyEditorSE 実装。文字列のみからではなく、文字列への変換をサポートしています。XML ベースのメタデータを使用して(適切に構成された)Spring コンテナーでこのクラスを使用するいくつかの例を以下に示します。
<bean id="errorDialog" class="...">
<!--
the 'messages' property is of type java.util.ResourceBundle.
the 'DialogMessages.properties' file exists at the root of the CLASSPATH
-->
<property name="messages" value="DialogMessages"/>
</bean> <bean id="errorDialog" class="...">
<!--
the 'DialogMessages.properties' file exists in the 'com/messages' package
-->
<property name="messages" value="com/messages/DialogMessages"/>
</bean>「適切に構成された」Spring container には、変換が透過的に行われるように CustomEditorConfigurer 定義が含まれている場合があります。
<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="java.util.ResourceBundle">
<bean class="org.springframework.beans.propertyeditors.ResourceBundleEditor"/>
</entry>
</map>
</property>
</bean> この PropertyEditorSE は、デフォルトではどの Spring インフラストラクチャにも登録されていないことに注意してください。
提案と最初のプロトタイプを提供してくれた David Leal Valmana に感謝します。
- 導入:
- 2.0
- 作成者:
- Rick Evans, Juergen Hoeller
フィールドのサマリー
フィールド修飾子と型フィールド説明static final StringSEconverting from a Stringの場合、ベース名とロケール(存在する場合)を区別するために使用されるセパレータ。コンストラクターの概要
コンストラクターメソッドのサマリー
フィールドの詳細
BASE_NAME_SEPARATOR
converting from a Stringの場合、ベース名とロケール(存在する場合)を区別するために使用されるセパレータ。- 関連事項:
コンストラクターの詳細
ResourceBundleEditor
public ResourceBundleEditor()
メソッドの詳細
setAsText
- 次で指定:
- インターフェース
PropertyEditorSEのsetAsTextSE - オーバーライド:
- クラス
PropertyEditorSupportSEのsetAsTextSE - 例外:
IllegalArgumentExceptionSE