クラス ApplicationConversionService
java.lang.ObjectSE
org.springframework.core.convert.support.GenericConversionService
org.springframework.format.support.FormattingConversionService
org.springframework.boot.convert.ApplicationConversionService
- 実装されたすべてのインターフェース:
Aware
、EmbeddedValueResolverAware
、ConversionService
、ConverterRegistry
、ConfigurableConversionService
、FormatterRegistry
ほとんどの Spring Boot アプリケーションに適したコンバーターとフォーマッターでデフォルトで構成された
FormattingConversionService
の特殊化。 直接インスタンス化のために設計されていますが、レジストリインスタンスに対するアドホック使用のための静的 addApplicationConverters(org.springframework.core.convert.converter.ConverterRegistry)
および addApplicationFormatters(FormatterRegistry)
ユーティリティメソッドも公開しています。
- 導入:
- 2.0.0
- 作成者:
- Phillip Webb
コンストラクターのサマリー
コンストラクター方法の概要
修飾子と型メソッド説明static void
addApplicationConverters
(ConverterRegistry registry) ほとんどの Spring Boot アプリケーションに役立つコンバーターを追加します。static void
addApplicationFormatters
(FormatterRegistry registry) ほとんどの Spring Boot アプリケーションに役立つフォーマッターを追加します。static void
addBeans
(FormatterRegistry registry, ListableBeanFactory beanFactory) <S,
T> void addConverter
(ClassSE<S> sourceType, ClassSE<T> targetType, Converter<? super S, ? extends T> converter) void
addConverter
(Converter<?, ?> converter) void
addConverter
(GenericConverter converter) void
addConverterFactory
(ConverterFactory<?, ?> factory) static void
区切り文字列をサポートするコンバーターを追加します。void
addFormatter
(Formatter<?> formatter) void
addFormatterForFieldAnnotation
(AnnotationFormatterFactory<? extends AnnotationSE> annotationFormatterFactory) void
addFormatterForFieldType
(ClassSE<?> fieldType, Formatter<?> formatter) void
addFormatterForFieldType
(ClassSE<?> fieldType, Printer<?> printer, Parser<?> parser) void
void
addPrinter
(Printer<?> printer) static void
configure
(FormatterRegistry registry) 指定されたFormatterRegistry
を、ほとんどの Spring Boot アプリケーションに適したフォーマッターとコンバーターで構成します。static ConversionService
共有のデフォルトアプリケーションConversionService
インスタンスを返し、必要に応じて遅延ビルドします。boolean
isConvertViaObjectSourceType
(TypeDescriptor sourceType, TypeDescriptor targetType) sourceType
のオブジェクトをtargetType
に変換でき、コンバーターがサポートされているソース・型としてObject.class
を持っている場合は、true
を返します。void
removeConvertible
(ClassSE<?> sourceType, ClassSE<?> targetType) クラス org.springframework.format.support.FormattingConversionService から継承されたメソッド
setEmbeddedValueResolver
クラス org.springframework.core.convert.support.GenericConversionService から継承されたメソッド
canBypassConvert, canConvert, canConvert, convert, convert, convertNullSource, getConverter, getDefaultConverter, toString
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSE
インターフェース org.springframework.core.convert.ConversionService から継承されたメソッド
convert
コンストラクターの詳細
ApplicationConversionService
public ApplicationConversionService()ApplicationConversionService
メソッドの詳細
addPrinter
- 次で指定:
- インターフェース
FormatterRegistry
のaddPrinter
- オーバーライド:
- クラス
FormattingConversionService
のaddPrinter
addParser
- 次で指定:
- インターフェース
FormatterRegistry
のaddParser
- オーバーライド:
- クラス
FormattingConversionService
のaddParser
addFormatter
- 次で指定:
- インターフェース
FormatterRegistry
のaddFormatter
- オーバーライド:
- クラス
FormattingConversionService
のaddFormatter
addFormatterForFieldType
- 次で指定:
- インターフェース
FormatterRegistry
のaddFormatterForFieldType
- オーバーライド:
- クラス
FormattingConversionService
のaddFormatterForFieldType
addConverter
- 次で指定:
- インターフェース
ConverterRegistry
のaddConverter
- オーバーライド:
- クラス
GenericConversionService
のaddConverter
addFormatterForFieldType
- 次で指定:
- インターフェース
FormatterRegistry
のaddFormatterForFieldType
- オーバーライド:
- クラス
FormattingConversionService
のaddFormatterForFieldType
addFormatterForFieldAnnotation
public void addFormatterForFieldAnnotation(AnnotationFormatterFactory<? extends AnnotationSE> annotationFormatterFactory) - 次で指定:
- インターフェース
FormatterRegistry
のaddFormatterForFieldAnnotation
- オーバーライド:
- クラス
FormattingConversionService
のaddFormatterForFieldAnnotation
addConverter
public <S,T> void addConverter(ClassSE<S> sourceType, ClassSE<T> targetType, Converter<? super S, ? extends T> converter) - 次で指定:
- インターフェース
ConverterRegistry
のaddConverter
- オーバーライド:
- クラス
GenericConversionService
のaddConverter
addConverter
- 次で指定:
- インターフェース
ConverterRegistry
のaddConverter
- オーバーライド:
- クラス
GenericConversionService
のaddConverter
addConverterFactory
- 次で指定:
- インターフェース
ConverterRegistry
のaddConverterFactory
- オーバーライド:
- クラス
GenericConversionService
のaddConverterFactory
removeConvertible
- 次で指定:
- インターフェース
ConverterRegistry
のremoveConvertible
- オーバーライド:
- クラス
GenericConversionService
のremoveConvertible
isConvertViaObjectSourceType
sourceType
のオブジェクトをtargetType
に変換でき、コンバーターがサポートされているソース・型としてObject.class
を持っている場合は、true
を返します。- パラメーター:
sourceType
- テストするソース型targetType
- テストするターゲット型- 戻り値:
ObjectTo...
コンバーターを介して変換が行われる場合- 導入:
- 2.4.3
configure
指定されたFormatterRegistry
を、ほとんどの Spring Boot アプリケーションに適したフォーマッターとコンバーターで構成します。- パラメーター:
registry
- 追加するコンバーターのレジストリ (また、ConversionService にキャスト可能でなければなりません。ConfigurableConversionService
であること)- 例外:
ClassCastExceptionSE
- 指定された FormatterRegistry を ConversionService にキャストできなかった場合
addApplicationConverters
ほとんどの Spring Boot アプリケーションに役立つコンバーターを追加します。- パラメーター:
registry
- 追加するコンバーターのレジストリ (また、ConversionService にキャスト可能でなければなりません。ConfigurableConversionService
であること)- 例外:
ClassCastExceptionSE
- 指定された ConverterRegistry を ConversionService にキャストできなかった場合
addDelimitedStringConverters
区切り文字列をサポートするコンバーターを追加します。- パラメーター:
registry
- 追加するコンバーターのレジストリ (また、ConversionService にキャスト可能でなければなりません。ConfigurableConversionService
であること)- 例外:
ClassCastExceptionSE
- 指定された ConverterRegistry を ConversionService にキャストできなかった場合
addApplicationFormatters
ほとんどの Spring Boot アプリケーションに役立つフォーマッターを追加します。- パラメーター:
registry
- デフォルトのフォーマッタを登録するサービス
addBeans
- パラメーター:
registry
- Bean を登録するサービスbeanFactory
- Bean を取得する Bean ファクトリ- 導入:
- 2.2.0