类 AnnotationConfigUtils
- java.lang.Object
- org.springframework.context.annotation.AnnotationConfigUtils
public abstract class AnnotationConfigUtils extends Object
Utility class that allows for convenient registration of commonBeanPostProcessor
andBeanFactoryPostProcessor
definitions for annotation-based configuration. Also registers a commonAutowireCandidateResolver
.- 从以下版本开始:
- 2.5
- 作者:
- Mark Fisher, Juergen Hoeller, Chris Beams, Phillip Webb, Stephane Nicoll
- 另请参阅:
ContextAnnotationAutowireCandidateResolver
,ConfigurationClassPostProcessor
,CommonAnnotationBeanPostProcessor
,AutowiredAnnotationBeanPostProcessor
,PersistenceAnnotationBeanPostProcessor
字段概要
字段 修饰符和类型 字段 说明 static String
AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Autowired annotation processor.static String
COMMON_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed JSR-250 annotation processor.static String
CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Configuration annotation processor.static String
CONFIGURATION_BEAN_NAME_GENERATOR
The bean name of the internally managed BeanNameGenerator for use when processingConfiguration
classes.static String
EVENT_LISTENER_FACTORY_BEAN_NAME
The bean name of the internally managed EventListenerFactory.static String
EVENT_LISTENER_PROCESSOR_BEAN_NAME
The bean name of the internally managed @EventListener annotation processor.static String
PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed JPA annotation processor.static String
REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME
已过时。as of 5.1, since no Required processor is registered by default anymore
构造器概要
构造器 构造器 说明 AnnotationConfigUtils()
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static void
processCommonDefinitionAnnotations(AnnotatedBeanDefinition abd)
static void
registerAnnotationConfigProcessors(BeanDefinitionRegistry registry)
Register all relevant annotation post processors in the given registry.static Set<BeanDefinitionHolder>
registerAnnotationConfigProcessors(BeanDefinitionRegistry registry, Object source)
Register all relevant annotation post processors in the given registry.
字段详细资料
CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME
public static final String CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Configuration annotation processor.- 另请参阅:
- 常量字段值
CONFIGURATION_BEAN_NAME_GENERATOR
public static final String CONFIGURATION_BEAN_NAME_GENERATOR
The bean name of the internally managed BeanNameGenerator for use when processingConfiguration
classes. Set byAnnotationConfigApplicationContext
andAnnotationConfigWebApplicationContext
during bootstrap in order to make any custom name generation strategy available to the underlyingConfigurationClassPostProcessor
.- 从以下版本开始:
- 3.1.1
- 另请参阅:
- 常量字段值
AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME
public static final String AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Autowired annotation processor.- 另请参阅:
- 常量字段值
REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME
@Deprecated public static final String REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME
已过时。as of 5.1, since no Required processor is registered by default anymoreThe bean name of the internally managed Required annotation processor.- 另请参阅:
- 常量字段值
COMMON_ANNOTATION_PROCESSOR_BEAN_NAME
public static final String COMMON_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed JSR-250 annotation processor.- 另请参阅:
- 常量字段值
PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME
public static final String PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed JPA annotation processor.- 另请参阅:
- 常量字段值
EVENT_LISTENER_PROCESSOR_BEAN_NAME
public static final String EVENT_LISTENER_PROCESSOR_BEAN_NAME
The bean name of the internally managed @EventListener annotation processor.- 另请参阅:
- 常量字段值
EVENT_LISTENER_FACTORY_BEAN_NAME
public static final String EVENT_LISTENER_FACTORY_BEAN_NAME
The bean name of the internally managed EventListenerFactory.- 另请参阅:
- 常量字段值
构造器详细资料
AnnotationConfigUtils
public AnnotationConfigUtils()
方法详细资料
registerAnnotationConfigProcessors
public static void registerAnnotationConfigProcessors(BeanDefinitionRegistry registry)
Register all relevant annotation post processors in the given registry.- 参数:
registry
- the registry to operate on
registerAnnotationConfigProcessors
public static Set<BeanDefinitionHolder> registerAnnotationConfigProcessors(BeanDefinitionRegistry registry, @Nullable Object source)
Register all relevant annotation post processors in the given registry.- 参数:
registry
- the registry to operate onsource
- the configuration source element (already extracted) that this registration was triggered from. May benull
.- 返回:
- a Set of BeanDefinitionHolders, containing all bean definitions that have actually been registered by this call
processCommonDefinitionAnnotations
public static void processCommonDefinitionAnnotations(AnnotatedBeanDefinition abd)