private static class ConditionalAnnotationHelper.ConditionContextImpl extends java.lang.Object implements ConditionContext
ConditionContext
.Modifier and Type | Field and Description |
---|---|
private ConfigurableListableBeanFactory |
beanFactory |
private Environment |
environment |
private BeanDefinitionRegistry |
registry |
Constructor and Description |
---|
ConditionalAnnotationHelper.ConditionContextImpl(BeanDefinitionRegistry registry,
Environment environment,
BeanNameGenerator beanNameGenerator) |
Modifier and Type | Method and Description |
---|---|
private ConfigurableListableBeanFactory |
deduceBeanFactory(java.lang.Object source) |
private Environment |
deduceEnvironment(BeanDefinitionRegistry registry) |
ConfigurableListableBeanFactory |
getBeanFactory()
Returns the
ConfigurableListableBeanFactory that will hold the bean
definition should the condition match. |
java.lang.ClassLoader |
getClassLoader()
Returns the
ClassLoader that should be used to load additional classes
or null if the default classloader should be used. |
Environment |
getEnvironment()
Return the
Environment for which the current application is running or
null if no environment is available. |
BeanDefinitionRegistry |
getRegistry()
Returns the
BeanDefinitionRegistry that will hold the bean definition
should the condition match. |
ResourceLoader |
getResourceLoader()
Returns the
ResourceLoader currently being used or null if the
resource loader cannot be obtained. |
private BeanDefinitionRegistry registry
private ConfigurableListableBeanFactory beanFactory
private Environment environment
public ConditionalAnnotationHelper.ConditionContextImpl(BeanDefinitionRegistry registry, Environment environment, BeanNameGenerator beanNameGenerator)
private ConfigurableListableBeanFactory deduceBeanFactory(java.lang.Object source)
private Environment deduceEnvironment(BeanDefinitionRegistry registry)
public BeanDefinitionRegistry getRegistry()
ConditionContext
BeanDefinitionRegistry
that will hold the bean definition
should the condition match.getRegistry
in interface ConditionContext
null
)public Environment getEnvironment()
ConditionContext
Environment
for which the current application is running or
null
if no environment is available.getEnvironment
in interface ConditionContext
null
public ConfigurableListableBeanFactory getBeanFactory()
ConditionContext
ConfigurableListableBeanFactory
that will hold the bean
definition should the condition match. If a
ConfigurableListableBeanFactory
is unavailable an
IllegalStateException
will be thrown.getBeanFactory
in interface ConditionContext
public ResourceLoader getResourceLoader()
ConditionContext
ResourceLoader
currently being used or null
if the
resource loader cannot be obtained.getResourceLoader
in interface ConditionContext
null
public java.lang.ClassLoader getClassLoader()
ConditionContext
ClassLoader
that should be used to load additional classes
or null
if the default classloader should be used.getClassLoader
in interface ConditionContext
null