类 AnnotationBeanDefinitionRegistryPostProcessor
- java.lang.Object
-
- io.microsphere.spring.beans.factory.annotation.AnnotationBeanDefinitionRegistryPostProcessor
-
- 所有已实现的接口:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.config.BeanFactoryPostProcessor
,org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
,org.springframework.context.EnvironmentAware
,org.springframework.context.ResourceLoaderAware
public abstract class AnnotationBeanDefinitionRegistryPostProcessor extends java.lang.Object implements org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor, org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.EnvironmentAware, org.springframework.context.ResourceLoaderAware, org.springframework.beans.factory.BeanClassLoaderAware
An abstract class for the extension toBeanDefinitionRegistryPostProcessor
, which will execute two main registration methods orderly:registerPrimaryBeanDefinitions(ExposingClassPathBeanDefinitionScanner, String[])
: Scan and register the primaryBeanDefinitions
that were annotated bythe supported annotation types
, and then return theMap
with bean name plus aliases if present and primaryAnnotatedBeanDefinitions
, it's allowed to be overrideregisterSecondaryBeanDefinitions(ExposingClassPathBeanDefinitionScanner, Map, String[])
: it's mandatory to be override by the sub-class to register secondaryBeanDefinitions
if required
- 从以下版本开始:
- 1.0.0
- 作者:
- Mercy
-
-
字段概要
字段 修饰符和类型 字段 说明 protected org.apache.commons.logging.Log
logger
-
构造器概要
构造器 构造器 说明 AnnotationBeanDefinitionRegistryPostProcessor(java.lang.Class<? extends java.lang.annotation.Annotation> primaryAnnotationType, java.lang.Class<?>... basePackageClasses)
AnnotationBeanDefinitionRegistryPostProcessor(java.lang.Class<? extends java.lang.annotation.Annotation> primaryAnnotationType, java.lang.Iterable<java.lang.String> packagesToScan)
AnnotationBeanDefinitionRegistryPostProcessor(java.lang.Class<? extends java.lang.annotation.Annotation> primaryAnnotationType, java.lang.String... packagesToScan)
-
方法概要
所有方法 静态方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 void
addSupportedAnnotationType(java.lang.Class<? extends java.lang.annotation.Annotation>... annotationTypes)
protected static java.lang.annotation.Annotation
getAnnotation(java.lang.reflect.AnnotatedElement annotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
org.springframework.beans.factory.config.ConfigurableListableBeanFactory
getBeanFactory()
java.lang.ClassLoader
getClassLoader()
org.springframework.core.env.ConfigurableEnvironment
getEnvironment()
java.util.Set<java.lang.String>
getPackagesToScan()
org.springframework.core.io.ResourceLoader
getResourceLoader()
protected java.util.Set<java.lang.String>
getSupportedAnnotationTypeNames()
java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>>
getSupportedAnnotationTypes()
void
postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
void
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
protected java.util.Map<java.lang.String,org.springframework.beans.factory.annotation.AnnotatedBeanDefinition>
registerPrimaryBeanDefinitions(ExposingClassPathBeanDefinitionScanner scanner, java.lang.String[] basePackages)
Scan and register the primaryBeanDefinitions
that were annotated bythe supported annotation types
, and then return theMap
with bean name plus aliases if present and primaryAnnotatedBeanDefinitions
.protected abstract void
registerSecondaryBeanDefinitions(ExposingClassPathBeanDefinitionScanner scanner, java.util.Map<java.lang.String,org.springframework.beans.factory.annotation.AnnotatedBeanDefinition> primaryBeanDefinitions, java.lang.String[] basePackages)
Register the secondaryBeanDefinitions
protected java.lang.String[]
resolveBasePackages(java.util.Set<java.lang.String> packagesToScan)
Resolve the placeholders for the raw scanned packages to scanprotected java.lang.Class<?>
resolveBeanClass(org.springframework.beans.factory.config.BeanDefinition beanDefinition)
protected java.lang.Class<?>
resolveBeanClass(org.springframework.beans.factory.config.BeanDefinitionHolder beanDefinitionHolder)
void
setBeanClassLoader(java.lang.ClassLoader classLoader)
void
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
void
setClassLoader(java.lang.ClassLoader classLoader)
void
setEnvironment(org.springframework.core.env.Environment environment)
void
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
-
-
-
构造器详细资料
-
AnnotationBeanDefinitionRegistryPostProcessor
public AnnotationBeanDefinitionRegistryPostProcessor(java.lang.Class<? extends java.lang.annotation.Annotation> primaryAnnotationType, java.lang.Class<?>... basePackageClasses)
-
AnnotationBeanDefinitionRegistryPostProcessor
public AnnotationBeanDefinitionRegistryPostProcessor(java.lang.Class<? extends java.lang.annotation.Annotation> primaryAnnotationType, java.lang.String... packagesToScan)
-
AnnotationBeanDefinitionRegistryPostProcessor
public AnnotationBeanDefinitionRegistryPostProcessor(java.lang.Class<? extends java.lang.annotation.Annotation> primaryAnnotationType, java.lang.Iterable<java.lang.String> packagesToScan)
-
-
方法详细资料
-
addSupportedAnnotationType
public void addSupportedAnnotationType(java.lang.Class<? extends java.lang.annotation.Annotation>... annotationTypes)
-
getAnnotation
protected static java.lang.annotation.Annotation getAnnotation(java.lang.reflect.AnnotatedElement annotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
-
postProcessBeanDefinitionRegistry
public final void postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) throws org.springframework.beans.BeansException
- 指定者:
postProcessBeanDefinitionRegistry
在接口中org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
- 抛出:
org.springframework.beans.BeansException
-
registerPrimaryBeanDefinitions
protected java.util.Map<java.lang.String,org.springframework.beans.factory.annotation.AnnotatedBeanDefinition> registerPrimaryBeanDefinitions(ExposingClassPathBeanDefinitionScanner scanner, java.lang.String[] basePackages)
Scan and register the primaryBeanDefinitions
that were annotated bythe supported annotation types
, and then return theMap
with bean name plus aliases if present and primaryAnnotatedBeanDefinitions
.Current method is allowed to be override by the sub-class to change the registration logic
- 参数:
scanner
-ExposingClassPathBeanDefinitionScanner
basePackages
- the base packages to scan- 返回:
- the
Map
with bean name plus aliases if present and primaryAnnotatedBeanDefinitions
-
registerSecondaryBeanDefinitions
protected abstract void registerSecondaryBeanDefinitions(ExposingClassPathBeanDefinitionScanner scanner, java.util.Map<java.lang.String,org.springframework.beans.factory.annotation.AnnotatedBeanDefinition> primaryBeanDefinitions, java.lang.String[] basePackages)
Register the secondaryBeanDefinitions
Current method is allowed to be override by the sub-class to change the registration logic
- 参数:
scanner
- theExposingClassPathBeanDefinitionScanner
instanceprimaryBeanDefinitions
- theMap
with bean name plus aliases if present and primaryAnnotatedBeanDefinitions
, which may be emptybasePackages
- the base packages to scan
-
postProcessBeanFactory
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) throws org.springframework.beans.BeansException
- 指定者:
postProcessBeanFactory
在接口中org.springframework.beans.factory.config.BeanFactoryPostProcessor
- 抛出:
org.springframework.beans.BeansException
-
resolveBasePackages
protected java.lang.String[] resolveBasePackages(java.util.Set<java.lang.String> packagesToScan)
Resolve the placeholders for the raw scanned packages to scan- 参数:
packagesToScan
- the raw scanned packages to scan- 返回:
- non-null
-
resolveBeanClass
protected final java.lang.Class<?> resolveBeanClass(org.springframework.beans.factory.config.BeanDefinitionHolder beanDefinitionHolder)
-
resolveBeanClass
protected final java.lang.Class<?> resolveBeanClass(org.springframework.beans.factory.config.BeanDefinition beanDefinition)
-
setBeanClassLoader
public void setBeanClassLoader(java.lang.ClassLoader classLoader)
- 指定者:
setBeanClassLoader
在接口中org.springframework.beans.factory.BeanClassLoaderAware
-
getSupportedAnnotationTypes
public java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getSupportedAnnotationTypes()
-
getSupportedAnnotationTypeNames
protected java.util.Set<java.lang.String> getSupportedAnnotationTypeNames()
-
getPackagesToScan
public java.util.Set<java.lang.String> getPackagesToScan()
-
getBeanFactory
public org.springframework.beans.factory.config.ConfigurableListableBeanFactory getBeanFactory()
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
- 指定者:
setBeanFactory
在接口中org.springframework.beans.factory.BeanFactoryAware
- 抛出:
org.springframework.beans.BeansException
-
getEnvironment
public org.springframework.core.env.ConfigurableEnvironment getEnvironment()
-
setEnvironment
public void setEnvironment(org.springframework.core.env.Environment environment)
- 指定者:
setEnvironment
在接口中org.springframework.context.EnvironmentAware
-
getResourceLoader
public org.springframework.core.io.ResourceLoader getResourceLoader()
-
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
- 指定者:
setResourceLoader
在接口中org.springframework.context.ResourceLoaderAware
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader classLoader)
-
-