Interface ConditionContext
public interface ConditionContext
Context information for use byCondition
implementations.- Since:
- 4.0
- Author:
- Phillip Webb, Juergen Hoeller
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConfigurableListableBeanFactory
getBeanFactory()
Return theConfigurableListableBeanFactory
that will hold the bean definition should the condition match, ornull
if the bean factory is not available (or not downcastable toConfigurableListableBeanFactory
).ClassLoader
getClassLoader()
Return theClassLoader
that should be used to load additional classes (onlynull
if even the system ClassLoader isn't accessible).Environment
getEnvironment()
Return theEnvironment
for which the current application is running.BeanDefinitionRegistry
getRegistry()
Return theBeanDefinitionRegistry
that will hold the bean definition should the condition match.ResourceLoader
getResourceLoader()
Return theResourceLoader
currently being used.
Method Detail
getRegistry
BeanDefinitionRegistry getRegistry()
Return theBeanDefinitionRegistry
that will hold the bean definition should the condition match.- Throws:
IllegalStateException
- if no registry is available (which is unusual: only the case with a plainClassPathScanningCandidateComponentProvider
)
getBeanFactory
@Nullable ConfigurableListableBeanFactory getBeanFactory()
Return theConfigurableListableBeanFactory
that will hold the bean definition should the condition match, ornull
if the bean factory is not available (or not downcastable toConfigurableListableBeanFactory
).
getEnvironment
Environment getEnvironment()
Return theEnvironment
for which the current application is running.
getResourceLoader
ResourceLoader getResourceLoader()
Return theResourceLoader
currently being used.
getClassLoader
@Nullable ClassLoader getClassLoader()
Return theClassLoader
that should be used to load additional classes (onlynull
if even the system ClassLoader isn't accessible).