类 AnnotationConfigUtils
- java.lang.Object
- org.springframework.context.annotation.AnnotationConfigUtils
public class AnnotationConfigUtils extends Object
Utility class that allows for convenient registration of commonBeanPostProcessorandBeanFactoryPostProcessordefinitions for annotation-based configuration. Also registers a commonAutowireCandidateResolver.- 从以下版本开始:
- 2.5
- 作者:
- Mark Fisher, Juergen Hoeller, Chris Beams, Phillip Webb, Stephane Nicoll
- 另请参阅:
ContextAnnotationAutowireCandidateResolver,ConfigurationClassPostProcessor,CommonAnnotationBeanPostProcessor,AutowiredAnnotationBeanPostProcessor,RequiredAnnotationBeanPostProcessor,PersistenceAnnotationBeanPostProcessor
字段概要
字段 修饰符和类型 字段 说明 static StringAUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAMEThe bean name of the internally managed Autowired annotation processor.static StringCOMMON_ANNOTATION_PROCESSOR_BEAN_NAMEThe bean name of the internally managed JSR-250 annotation processor.static StringCONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAMEThe bean name of the internally managed Configuration annotation processor.static StringCONFIGURATION_BEAN_NAME_GENERATORThe bean name of the internally managed BeanNameGenerator for use when processingConfigurationclasses.static StringEVENT_LISTENER_FACTORY_BEAN_NAMEThe bean name of the internally managed EventListenerFactory.static StringEVENT_LISTENER_PROCESSOR_BEAN_NAMEThe bean name of the internally managed @EventListener annotation processor.static StringPERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAMEThe bean name of the internally managed JPA annotation processor.static StringREQUIRED_ANNOTATION_PROCESSOR_BEAN_NAMEThe bean name of the internally managed Required annotation processor.
构造器概要
构造器 构造器 说明 AnnotationConfigUtils()
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidprocessCommonDefinitionAnnotations(AnnotatedBeanDefinition abd)static voidregisterAnnotationConfigProcessors(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 processingConfigurationclasses. Set byAnnotationConfigApplicationContextandAnnotationConfigWebApplicationContextduring 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
public static final String REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME
The 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, 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)