クラス AnnotationConfigContextLoader
- 実装されているすべてのインターフェース:
AotContextLoader、ContextLoader、SmartContextLoader
AbstractGenericContextLoader の具象実装。 コンポーネントクラスの定義については、@ContextConfiguration の Javadoc を参照してください。
メモ: AnnotationConfigContextLoader は、レガシー ContextLoader API によって定義された文字列ベースのリソースの場所ではなく、コンポーネントクラスをサポートします。AnnotationConfigContextLoader は AbstractGenericContextLoader を継承しますが、AnnotationConfigContextLoader は AbstractContextLoader または AbstractGenericContextLoader によって定義された文字列ベースのメソッドをサポートしません。AnnotationConfigContextLoader は主に ContextLoader ではなく SmartContextLoader と見なす必要があります。
コンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明protected BeanDefinitionReaderprotected ClassSE<?>[]detectDefaultConfigurationClasses(ClassSE<?> declaringClass) 提供されたテストクラスのデフォルトの構成クラスを検出します。protected StringSE[]generateDefaultLocations(ClassSE<?> clazz) protected StringSEprotected voidloadBeanDefinitions(GenericApplicationContext context, MergedContextConfiguration mergedConfig) 提供されたMergedContextConfigurationのクラスから、提供されたcontextのクラスを登録します。protected StringSE[]modifyLocations(ClassSE<?> clazz, StringSE... locations) voidprocessContextConfiguration(ContextConfigurationAttributes configAttributes) 提供されたContextConfigurationAttributesのコンポーネントクラスを処理します。protected voidvalidateMergedContextConfiguration(MergedContextConfiguration mergedConfig) 提供されたMergedContextConfigurationにlocationsが含まれていないことを確認してください。クラス org.springframework.test.context.support.AbstractGenericContextLoader から継承されたメソッド
createContext, customizeBeanFactory, customizeContext, loadContext, loadContext, loadContextForAotProcessing, loadContextForAotRuntime, prepareContextクラス org.springframework.test.context.support.AbstractContextLoader から継承されたメソッド
customizeContext, getResourceSuffixes, isGenerateDefaultLocations, prepareContext, processLocationsクラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース org.springframework.test.context.SmartContextLoader から継承されたメソッド
processLocations
コンストラクターの詳細
AnnotationConfigContextLoader
public AnnotationConfigContextLoader()
メソッドの詳細
processContextConfiguration
提供されたContextConfigurationAttributesのコンポーネントクラスを処理します。コンポーネントクラスが
nullまたは空で、AbstractContextLoader.isGenerateDefaultLocations()がtrueを返す場合、このSmartContextLoaderはdetect default configuration classesを試行します。デフォルトが検出された場合、提供された構成属性ではsetになります。それ以外の場合、提供された構成属性のプロパティは変更されません。- 次で指定:
- インターフェース
SmartContextLoaderのprocessContextConfiguration - オーバーライド:
- クラス
AbstractContextLoaderのprocessContextConfiguration - パラメーター:
configAttributes- 処理するコンテキスト構成属性- 関連事項:
detectDefaultConfigurationClasses
提供されたテストクラスのデフォルトの構成クラスを検出します。デフォルトの実装は、単に
AnnotationConfigContextLoaderUtils.detectDefaultConfigurationClasses(Class)に委譲するだけです。- パラメーター:
declaringClass-@ContextConfigurationを宣言したテストクラス- 戻り値:
- デフォルト構成クラスの配列。空の可能性がありますが、
nullはありません - 関連事項:
modifyLocations
AnnotationConfigContextLoaderは、レガシーContextLoaderではなく、SmartContextLoaderとして使用する必要があります。このメソッドはサポートされていません。- オーバーライド:
- クラス
AbstractContextLoaderのmodifyLocations - パラメーター:
clazz- 場所が関連付けられているクラスlocations- 変更するリソースの場所- 戻り値:
- 変更されたアプリケーションコンテキストリソースの場所の配列
- 例外:
UnsupportedOperationExceptionSE- この実装- 関連事項:
generateDefaultLocations
AnnotationConfigContextLoaderは、レガシーContextLoaderではなく、SmartContextLoaderとして使用する必要があります。このメソッドはサポートされていません。- オーバーライド:
- クラス
AbstractContextLoaderのgenerateDefaultLocations - パラメーター:
clazz- デフォルトの場所が生成されるクラス- 戻り値:
- デフォルトのアプリケーションコンテキストリソースの場所の配列
- 例外:
UnsupportedOperationExceptionSE- この実装- 関連事項:
getResourceSuffix
AnnotationConfigContextLoaderは、レガシーContextLoaderではなく、SmartContextLoaderとして使用する必要があります。このメソッドはサポートされていません。- 次で指定:
- クラス
AbstractContextLoaderのgetResourceSuffix - 戻り値:
- リソースのサフィックス。
nullまたは空にしない - 例外:
UnsupportedOperationExceptionSE- この実装- 関連事項:
validateMergedContextConfiguration
提供されたMergedContextConfigurationにlocationsが含まれていないことを確認してください。- オーバーライド:
- クラス
AbstractGenericContextLoaderのvalidateMergedContextConfiguration - パラメーター:
mergedConfig- 検証するマージされた構成- 導入:
- 4.0.4
- 関連事項:
loadBeanDefinitions
protected void loadBeanDefinitions(GenericApplicationContext context, MergedContextConfiguration mergedConfig) 提供されたMergedContextConfigurationのクラスから、提供されたcontextのクラスを登録します。各クラスはコンポーネントクラスを表す必要があります。
AnnotatedBeanDefinitionReaderは、適切な Bean 定義を登録するために使用されます。AnnotatedBeanDefinitionReaderはBeanDefinitionReaderのインスタンスではないため、このメソッドはcreateBeanDefinitionReader(org.springframework.context.support.GenericApplicationContext)を呼び出しません。- オーバーライド:
- クラス
AbstractGenericContextLoaderのloadBeanDefinitions - パラメーター:
context- コンポーネントクラスを登録する必要があるコンテキストmergedConfig- クラスを取得するマージされた構成- 関連事項:
createBeanDefinitionReader
AnnotationConfigContextLoaderは、レガシーContextLoaderではなく、SmartContextLoaderとして使用する必要があります。このメソッドはサポートされていません。- 次で指定:
- クラス
AbstractGenericContextLoaderのcreateBeanDefinitionReader - パラメーター:
context-BeanDefinitionReaderを作成する必要があるコンテキスト- 戻り値:
- 指定されたコンテキストの
BeanDefinitionReader - 例外:
UnsupportedOperationExceptionSE- この実装- 関連事項: