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